Git Product home page Git Product logo

Comments (5)

koistya avatar koistya commented on May 1, 2024

I don't want to mix templating engines. The reasoning behind "layouts", "pages" and "components" folders is to organize React.js components. For example you may have a StoreLayout React.js component with OnlineStore menu on it, the list of recently viewed products. Also you may have a few pages which will be nested inside this "layout" - CheckoutPage, ProductInfoPage etc. and you may also have small React components reused across many pages of the site like ShoppingCartStatus, CheckoutButton etc.

Do you have a better idea how to organize React components?

from react-starter-kit.

ds0nt avatar ds0nt commented on May 1, 2024

I think that purely components is more straightforward. Also, my page is a one-page app, I only have one layout and one page, that are in the same file. Everthing else is components (some of which could be considered layouts). But one html file.

from react-starter-kit.

devel-pa avatar devel-pa commented on May 1, 2024

I prefer Layouts and Pages as I want to have many virtual pages inside the application, each page gives a part of the application flow with components, which are only a small area of the page.
Layouts are good as some of the pages looks in a way, others in a different way, and combines some of the common components.
For me is a good separation of concern and helps me to focus only on some areas and reuse a lot of code.
I have no other explanation why I prefer to not have the pages and layouts in components than personal taste (and maybe because I don't like SPAs with only one virtual page)
Anyway, I think is very easy to remove that extra functionality if you don't need it.

from react-starter-kit.

koistya avatar koistya commented on May 1, 2024

Maybe supporting multiple layouts is an overkill.. How many layouts do your web applications usually have? Probably just a two or three. If so, a single layout component (top-level React component) can easily support multiple rendering options, for example with or without header & footer.

from react-starter-kit.

koistya avatar koistya commented on May 1, 2024

In the latest version there is no concepts of layouts and pages. There is now a single top-level component, see ./src/components/App. So, I guess this issue is no longer relevant.

from react-starter-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.