Warning: Unknown props on <div> tag.
See original GitHub issueI have this error with disableTriggerFocus
, disableTriggerHover
props.
these two props are shared between logic and style part of a tooltip component.
How can I handle shared props for style purpose and logic component purpose?
Version
2.1.1
Reproduction
https://www.webpackbin.com/bins/-KxN8G3pDI0nHJTNmExw
Steps to reproduce
Open the webpackbin reproduction and open the chrome devTools console. there you can see the React Warning message.
Expected Behavior
Props used for Styled-component will be filtered by the wrapper function styled
Actual Behavior
passing these two variable return this unwanted warning.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
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 >Fix React Warning: Unknown prop on <> tag. Remove this ...
That warning is happening because you're passing onClickProp , etc to a div element in one of your components. A div element by...
Read more >Get rid of `Unknown props` react's warnings : HUB-4674
Widgets list Unknown prop applicationName on <div> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop.
Read more >[Solved]-Unknown prop `float` on <div> tag-Reactjs
Any idea how to check if a div contains ONLY an image tag inside it? ... How can I display a div tag...
Read more >Unknown props `onExited`, `appear`, `enter`, `exit` on <li> tag ...
Console error: Warning: Unknown props `onExited`, `appear`, `enter`, `exit` on <li> tag. ; div className= ; h1> · </ ; input type ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mxstbr I have a similar issue with
Styled(Link)
where I am using a prop for styling the link and it gets passed to React-Router’s Link which further passes it to the DOM leading to the warnings. Is there a recommended way to prevent that styling prop from being passed?@mxstbr Can we re-open this? It would be great to have the possibility to pass props that are only meant for styling. What about a prop with a specific name that would not be passed down, like
styledProps
or something? Would let us pass an object with values used only for styling Not saying it’s the best idea, but there should be a solution around this