Discussion about this post

User's avatar
Mikita Aliaksandrovich's avatar

Interesting points! Thanks for sharing!

Expand full comment
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
8 more comments...

No posts