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.

Warning: Unknown props on <div> tag.

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
oyeanujcommented, Nov 14, 2017

@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?

2reactions
tgroutarscommented, Aug 31, 2018

@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

Read more comments on GitHub >

github_iconTop 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 >

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