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.
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.
Thank you for adding this, Rado! I like both approaches + extracting these things outside the main component into separate files.
Solid tips my friend ,they are part of Clean Code.
Thank you, Daniel! 🙌
Interesting points! Thanks for sharing!