DEV Community

Discussion on: ReactJS: Component everything or not?

Collapse
 
harveyhalwin profile image
Heinek Halwin

Hi Jean,
I also very recently started with react js and what I found out was that, it's better to component stuff if u want to reuse it later. Otherwise, I don't see how we get the value out of it.

Also, regarding putting everything inside the app.js, it's best to keep it as clean as possible. So what I did was, I built a pages folder(inside src) and i built the page component, which would have my form or my html elements. Then I would import it as a component in my app.js. Making my app.js much cleaner and easier to look at. This would also make it easier, if ur planning to use routing in the future.

Good Luck !

Collapse
 
snoopydev profile image
SnoopyDev

I really like your way!

Collapse
 
stereoplegic profile image
Mike Bybee

You're thinking about future reuse. That's good. Never know when you might be able to base an entire UI component library on the ones you created for your current project.