question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Tabs] unrecognized prop to DOM if child <Tab/> is wrapped

See original GitHub issue

I want tabs that are right-clickable with mouse and user would have option to open in new tab. Like all normal links <a ...> ...</a> So i add <Link/> around <Tab/> and it does the job but my console is full of errors on development env.

Warning: React does not recognize the fullWidth prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase fullwidth instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Warning: React does not recognize the textColor prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase textcolor instead. If you accidentally passed it from a parent component, remove it from the DOM element.

I wonder if i could solve this somehow? 🤔

import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import {Link} from 'react-router-dom';
<Tabs
  value={this.state.tab}
  onChange={this.handleChangeTab}
  indicatorColor="primary"
  centered
>
  <Link className={'lnu'} to={'/user/account/update-details'}><Tab label={'Account'}/></Link>
  <Link className={'lnu'} to={'/user/account/password-change'}><Tab label={'Password'}/></Link>
  <Link className={'lnu'} to={'/user/account/loyalty-discount'}><Tab label={'Discount'}/></Link>
</Tabs>
Tech Version
Material-UI v3.0.0
React 16.4.2
Browser chrome Version 68.0.3440.106 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

21reactions
oliviertassinaricommented, Mar 2, 2021

The correct solution is documented in https://material-ui.com/guides/composition/#routing-libraries:

import { Link } from 'react-router-dom'
import Tab from '@material-ui/core/Tab';

<Tab component={Link} to="/open-collective">
  Link
</Tab>
2reactions
ka7ehcommented, Mar 2, 2021

I’m getting the same error with MenuItems in MUI 4.5.1. I’m using the component as it was suggested for Tabs:

<MenuItem component={Link} to="/about">
    About
</MenuItem>
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Tabs] unrecognized prop to DOM if child <Tab/> is wrapped
I want tabs that are right-clickable with mouse and user would have option to open in ... [Tabs] unrecognized prop to DOM if...
Read more >
Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >
How to access prop passed to first tab in other tabs in react ...
Yes! I found the problem in 'Tab'. Tabs are 'wrapped' by default - i.e. all children are wrapped by Stack with own nav...
Read more >
useTabList – React Aria - React Spectrum Libraries
The items prop can be used when creating tabs from a dynamic collection, for example when the user can add and remove tabs,...
Read more >
React Does Not Recognize The 'Fullwidth' Prop On A Dom ...
You can pass a custom component as the tabs prop to override the default about unrecognized DOM attributes, and an error about missing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found