DEV Community

Discussion on: ReactJS: Component everything or not?

Collapse
 
giologist profile image
Gio

KISS always, till you need to add complexity.

Do not feel the need to extract everything into a component, yet alone things that won't be reused much.

I tend to build on projects right from the App.js initially, as you mentioned. I only extract once I find myself reusing bits of code (time for a component) or wanting to isolate state and functionality for a larger piece of the app.

Collapse
 
stereoplegic profile image
Mike Bybee • Edited

This is good for a starting point, but it's important to note that large, hard-to-read files you didn't split up, just because you didn't see a case for code reuse, are the opposite of simple.

Collapse
 
giologist profile image
Gio

Yep, after a certain point, it's worth extracting simply from a hierarchical and organizational standpoint ✊🏻