Classname warning appears because loadable loading component doesn't attach it
See original GitHub issueWhen you try to style a HOC [like react-loadable] you will get a console.warn
, that the className is not being passed down, even if it is.
Reproduction
https://codesandbox.io/s/pyx951r0rj
Steps to reproduce
Open the console.
Expected Behavior
No console.warn
Actual Behavior
There is this console.warn
It looks like you've wrapped styled() around your React component (LoadableComponent), but the className prop is not being passed down to a child. No styles will be rendered unless className is composed within your React component.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Warning: Prop `className` did not match. when using styled ...
It looks like the className prop that is being set on your component is not the same when the component is rendered on...
Read more >Using React Loadable for Code Splitting by Components and ...
Code splitting is a technique where an application only loads the code it needs at the moment, and nothing more. For example, when...
Read more >FAQs - styled-components
The warning message below indicates that non-standard attributes are being attached to HTML DOM elements such as <div> or <a>. If you are...
Read more >Best practices for React iframes - LogRocket Blog
Explore two use cases for React iframes, embedding external content in a web application and isolating certain parts of an app.
Read more >Docs • Svelte
If you export a const , class or function , it is readonly from outside the component. Functions are valid prop values, however,...
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 FreeTop 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
Top GitHub Comments
For the folks using
Next.js
, don’t forget to add this .babelrc config to your project.styled(SomeComponent) is not an unrecommended pattern. It’s a core use case in fact.
On Sun, Oct 21, 2018, 3:20 PM Phil Plückthun notifications@github.com wrote: