DEV Community

Discussion on: How you handle non reusable components in react?

Collapse
 
joelmturner profile image
Joel Turner

Good question! I'm guessing it depends on your setup and if your building this as part of a team.

On my dev team, we usually break them out into their own file unless it's a styled component just for that parent component.

Currently we keep them in a folder for that specific item. For example, if we had a PanelRenderer that had a specific PanelChilr that only worked for it they would be placed in the PanelRenderer directory.

Even if it's only used once, we prefer to type them fully. This helps with future refactors, bug fixes, additional features.