Replies: 1 comment
-
|
By default, styled components show up as Styled.div or similar in React DevTools because JS can’t infer variable names at runtime. Solution: Manually set a displayName:💡 Better: Use babel-plugin-styled-components — it auto-generates display names based on your variable names. Just install and add it to your Babel config. This makes debugging much easier with zero extra code. Hope that helps!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
I've noticed that whenever I'm styling a component it shows in react dev tools as Styled.[tag] with a forwardRef for the html element.
My suggestion is pretty basic, make all the components created to be named.
I'm not fluent in the inner workings of the library but if a 3rd argument can be passed into the component to give it a name, or somehow make the component derive it's name from the variable it's being passed into (magic?) it would be awesome!
Beta Was this translation helpful? Give feedback.
All reactions