material-table: Invalid prop type: Invalid prop `color` of value `inherit`

I’m encountering this error lately (latest version of everything)

index.js:1375 Warning: Failed prop type: Invalid prop color of value inherit supplied to ForwardRef(FormControl), expected one of [“primary”,“secondary”]. in ForwardRef(FormControl) (created by WithStyles(ForwardRef(FormControl))) in WithStyles(ForwardRef(FormControl)) (created by ForwardRef(TextField)) in ForwardRef(TextField) (created by WithStyles(ForwardRef(TextField))) in WithStyles(ForwardRef(TextField)) (created by MTableToolbar) in div (created by ForwardRef(Toolbar)) in ForwardRef(Toolbar) (created by WithStyles(ForwardRef(Toolbar))) in WithStyles(ForwardRef(Toolbar)) (created by MTableToolbar) in MTableToolbar (created by WithStyles(MTableToolbar)) in WithStyles(MTableToolbar) (created by MaterialTable) in div (created by ForwardRef(Paper)) in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper))) in WithStyles(ForwardRef(Paper)) (created by Container) in Container (created by MaterialTable) in Provider (created by App) in App (created by ErrorBoundary) in ErrorBoundary (created by DragDropContext) in DragDropContext (created by MaterialTable) in MaterialTable

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 41
  • Comments: 42 (11 by maintainers)

Most upvoted comments

Is there an expected release date for the version that will resolve this issue?

I’m also seeing this error with the recent material-ui update.

When should we expect this fix to be published on npm?

Ok, ill now post the easiest way there could be:

Go into your node_modules/material-table/dist/components/m-table-toolbar.js file Then to line 124 change remove or comment // color: “inherit”,

save and restart app

Note: If you should do npm install again, you will probably have to repeat the step until the official version is out 😉

Hopefully something will be released soon, each github mail arrives I’m thinking that one of the other issues is being addressed, but its away this one haha

Not fixed, still getting it

Guys, I think everyone should read previous comments before posting any new comments.

Thanks.

This is already done and pushed to master (commit: https://github.com/mbrn/material-table/commit/8cda5e7b208799ecc440fa15de92ef852c11a88d), so it will be solved in the next update.

@mbrn I still get this error about color=“inherit” on release 1.57.2 when enabling toolbar: true in the options prop.

Apologize, I haven’t had a chance to dig into it, but just in case others are experiencing the same thing

This was fixed at 8cda5e7

changing the dependencies version of material-ui/core in package.json helped me. actually the material core UI update is not supporting the color value as inherit downgrading the dependency will help to solve this error. “dependencies”: { “@material-ui/core”: “~4.5.1”}

Multiple others have suggested this, but downgrading @material-ui/core could include other breaking changes if users are using 4.5.2 or 4.6.1 features and thus isn’t an ideal solution.

Alternatively, I would recommended to remove all instances of (color=“inherit”) in file node_modules/material-table/src/components/m-table-toolbar.js (Note you will have to restart your application after this change)

Whenever a fix is available from publisher, you can then update the package and the file will be replaced with publisher’s version.

It will all depend on @mbrn from the author itself

There is already an opened PR, let’s just wait for it to be merged. Cheers everyone!

I think the error is caused by one of those:

https://github.com/mbrn/material-table/search?q=color%3D"inherit"&unscoped_q=color%3D"inherit"

Probably caused by some recent change which only permits “primary” or “secondary” as a color

Addition: Some time ago i did not have this errors so it can’t be something in my code