Also a SPA with no routes seems useless, never seen that in prod before. For just trying something out, the docs literally refer to a downloadable sandbox as the very first way to try React
Comments
Log in with your Bluesky account to leave a comment
Honestly what am I missing here? I’m sorry if this comes off condescending but I feel like I’m arguing for the self evident and now I feel like the crazy one
it really depends on the teaching approach. but a lot of people start learning with HTML. so being able to create pages and links between them is something they know early. then with your proposed way this knowledge goes out of the window — you have to switch the template and mindset to add links
it’s not some theoretical thing, it’s what we were seeing during years of CRA popularity. people complain how confusing it is to add a router because you have to turn your existing template inside-out. most beginners just copy pasted definitions they didn’t understand
the proposed approach here isn’t something 1000% different. you still start with a “single page”. you can do your calculator or todomvc or whatnot there.
but *when* you need to add another page, you don’t need to turn your code inside out. you just create a file.
Well, first you have to understand some very obtuse file naming conventions. App router is not simple. I have to look up the docs every time I use it. Sure it scales/has a lot of features but there’s something to be said for starting simple and actually learning how all the pieces fit together IMO.
A common grief I hear against modern React is how far it strayed from its original "just a JS library, use it with whatever else you want" philosophy. Things like this contribute to this perception. I don't want to start with a router, I want to learn its bare minimum.
I'm not sure links are actually the first thing new users jump to; JSX, the rendering model, state & props, etc., are all things that are important to get a hold of first and can be done in a single page.
Links aren't even interesting, `...` and you're done. Unlikely to trip users up
Comments
You know how your phone has apps with no associated URLs per view? You can do that on the web too.
It could be a game. It could be a utility like a todo list. It could be any of the very useful things created in the first few years react was a thing
but *when* you need to add another page, you don’t need to turn your code inside out. you just create a file.
same with loading data etc
Links aren't even interesting, `...` and you're done. Unlikely to trip users up
They provide guidance for folks looking to add routing. https://vuejs.org/guide/scaling-up/routing.html#official-router
Perhaps it’s not equivalent to CRAs goals, but I like the approach. Their docs also help you understand when a meta framework is more appropriate.