Discussion about this post

User's avatar
Radoslav Stankov's avatar

Good points.

I had a similar post a long time ago.

https://blog.rstankov.com/structuring-react-components/

I prefer the exported types and main components to be on the top and all internal file types, helpers, and subcomponents to be below it.

Because one usually reads files from top to bottom, the file is organized in terms of priority. We, more often than not, use a component rather than modify it. Thus, the external components and interfaces are more important than the internal details.

Expand full comment
Daniel Moka's avatar

Solid tips my friend ,they are part of Clean Code.

Expand full comment
3 more comments...

No posts