DEV Community

Discussion on: Advanced Usage of Styled Components for your React App - Part 1

Collapse
 
lucassperez profile image
Lucas Perez • Edited

Nice article! Styled components are very cool, indeed.
What do you think about defining your styled components inside the same file as your normal component? This way you could potentially have a single file component, something that Vuers seem to love.
I haven't thought much about this much, just asking for some opinion.

Collapse
 
olenadrugalya profile image
Olena Drugalya

Yes, you can surely do that. But it’s always good to devide logic from styling in my opinion. And sometimes a component can have only styles (like a wrapper), so it is not necessary to create separate file for that. Like you can have Menu.js and Menu.styles.js which include MenuWrapper and MenuContainer