Comments (5)
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.
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.
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.
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.
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)
- Need help building an old website from 2016 HOT 5
- Error 500: Unexpected token < in JSON at position 0 HOT 3
- SPAM
- 'Cannot find module' Error for cached modules in VSCode HOT 1
- Minor issue running 'Relay' with Yarn HOT 1
- Cannot find module ... TypeScript error in VSCode HOT 1
- Hot Reload not working properly HOT 1
- Hot Reload CSS and JS files changes HOT 1
- Cannot open started application due to Firebase error HOT 2
- site.manifest error - comma missing
- What kind of API token templates should I use? HOT 1
- Where's node_modules?
- Where's node_modules? HOT 1
- Error on first start. TT HOT 2
- Network: use --host to expose HOT 1
- Codespaces not working with "Use Template" (workaround: clone/fork/duplicate repo) HOT 5
- The engine "node" is incompatible with this module. Expected version "10". Got "18.14.0" HOT 5
- Shipping with Google_Cloud_Credentials Issue HOT 2
- Login Dialog is not showing up
- Unable to add packages using Yarn HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-starter-kit.