Home > Software engineering >  Warning: Warning: React does not recognize the `textColor` prop on a DOM element
Warning: Warning: React does not recognize the `textColor` prop on a DOM element

Time:10-12

Getting this warning in browser console.(code doesn't fail, everything works).

screenshot of error in browser

Importing Tabs from material ui.

import { ImageWithFallback, Paper, Tabs, Tab, Typography, Tooltip,} from '@material-ui-core/dist';

And using it in my component this way-

<Paper square className={classes.root} data-test-id={testMediaEditRenditionTabPanel.paper}>
  <Tabs
    value={tabState}
    variant="scrollable"
    onChange={handleChange}
    orientation="vertical"
    indicatorColor="primary"
    centered
    textColor="primary"
    className={classes.tabs}
  >
  </Tabs>
  </paper>

PS: New to React, help and guidance will be much appreciated. Thanks in advance.

CodePudding user response:

textColor seems to be an attribute on Tab component instead of the Tabs component. Try adding a tab within the Tabs component and then set textColor to primary.

CodePudding user response:

Did you try with textcolor instead of textColor? I think the material UI of your project seems not to be the latest version. Please let me know how it works.

  • Related