I get styled-components warning, if using react-table-library
See original GitHub issueHey,
I have an app (create-react-app) with the styled-components
-dependency. Now I added react-table-library
and get following warning:
It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
See https://s-c.sh/2BAXzed for more info.
I see, we have babel-plugin-styled-components
at package.json of react-table-library
, but I can’t figure out why the warning happened, so far.
Do you have an idea? Should we mark styled-components
as external in this lib? Do you know a workaround for now (maybe resolutions
)?
Thx
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Module not found: Can't resolve 'styled-component' [closed]
But when I use it in component, I am getting following error. Failed to compile. ./src/Components/Lightbox/styledLightbox.js. Module not found:.
Read more >How To Use Styled-Components In React - Smashing Magazine
Styled components are independent of each other, and you do not have to worry about their names because the library handles that for...
Read more >How to use styled components with Material UI in a React app
Styled -components is another great library used to style React components. We do so by defining React “styled” components without CSS classes.
Read more >Basics - styled-components
If the component is unused (which tooling can detect) and gets deleted, all its styles get deleted with it. Simple dynamic styling: adapting...
Read more >React 18: having Invalid hook call problem with rendering app ...
I have a problem with rendering app after migrating to 18 version const root = ReactDOM.createRoot(document.getElementById('root')); const ...
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
Let’s keep the babel plugin for now. I have only SC before and switched to the babel plugin under the assumption that SC would go away this way. But like you said, the plugin uses SC under the hood.
The babel plugin could be removed by using default SC styling. I can’t think of a better alternative (in best case no dep) to SC either. With emotion it would be the same, wouldn’t it?
What do you think of just using SASS? Library users could apply custom themes, by using table-library’s class names.