This is obviously an opinionated subject. Ever since NextJS became popular I follow their folder structure, so src/pages, then do something similar to what you have outside of pages. Except I've never been a fan of the module based folder structure, so I always have folders for models, hooks, context, components (dumb components), containers (smart components).
Also there's a really good presentation from the NextJS conference about how to set up your project with shared components for NextJS (web) and React Native (app). This was just a few days ago, so I've changed my approach to mimic that with CRA as well.
I worked with both module based and container based structure of React. IMO container approach has lower entry level but in long term modules allow to easily extracting and reusing entire modules as dependency in different application.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is obviously an opinionated subject. Ever since NextJS became popular I follow their folder structure, so
src/pages
, then do something similar to what you have outside of pages. Except I've never been a fan of the module based folder structure, so I always have folders for models, hooks, context, components (dumb components), containers (smart components).Also there's a really good presentation from the NextJS conference about how to set up your project with shared components for NextJS (web) and React Native (app). This was just a few days ago, so I've changed my approach to mimic that with CRA as well.
Could you kindly share a link to said NextJS shared components presentation? Thank you!
Starts at 1:44:04
youtu.be/PWi-49ODKAs
youtu.be/PWi-49ODKAs
Starts at 1:44:04
GitHub NextJS Strapi DEMO
Thank you!
I worked with both module based and container based structure of React. IMO container approach has lower entry level but in long term modules allow to easily extracting and reusing entire modules as dependency in different application.