internal styled-components throws warning
See original GitHub issueThe component styled.div with the id of "sc-AxiKw" has been created dynamically.
You may see this warning because you've called styled inside another component.
To resolve this only create new StyledComponents outside of any render method and function component.
here is the issue pointing: https://github.com/elrumordelaluz/reshake/blob/master/src/Shake.js#L67
I guess the styling should be completely outside of the render method using params, or even better not using styled-components
at all and handle everything with just style
?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Get rid of warning when dynamically rendering React styled ...
To resolve this only create new StyledComponents outside of any render method and function component.
Read more >Failed context type warning when using external React ...
Version styled-components: 3.1.5 Issue During my work on a project I had an idea for a ... Warning: Failed context type: Invalid context...
Read more >Basics - styled-components
Simple dynamic styling: adapting the styling of a component based on its props or a global ... WARNING: THIS IS VERY VERY BAD...
Read more >Invalid Hook Call Warning - React
Hooks can only be called inside the body of a function component. ... function Bad2() { const style = useMemo(() => { //...
Read more >react-hydration-error - Next.js
In general this issue is caused by using a specific library or application code that is relying on something that could differ between...
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
@elrumordelaluz Opened PR. The issue was solved rather simply, so I refactored the code a bit too.
PS, as mentioned in the PR message, let me know if you are interested in creating typescript types for this package
My pleasure, can you put me up as collaborator on npm?