I’m conflicted and very confused on what I should use… From what I understand, if it’s a static website, small apps you’d want to use create-react-app. What about bigger sites that I intend for users to use and interact with? like a social media app.
“if it’s a static website, small apps you’d want to use create-react-app.”
That’s probably true, because CRA doesn’t have a lot of infrastructure built into it. But that doesn’t necessarily mean that as it gets bigger, you must switch to a different thing - there are plenty of big apps built with CRA.
I think you’re too worried about this. I would start with CRA. After you get comfortable with that, try and build a few projects with the other two - it’d be nice to put them on a resume.
React isn’t particularly useful for static websites. Why would you make a static website using a JS SPA library/framework? They’re designed for building applications.
The component model it uses, the way you build the structure of apps, that is quite useful as a way to generate a static site. This is Gatsby, which is at core a static site generator.
One way React apps can work is that you can tell React to generate HTML (instead of using
ReactDOM.render(), you use
ReactDOMServer.renderToString()), and do that on a server (so it renders very fast at first, like a static site). Then all the dynamic JS stuff can be loaded in afterwards. Any React app can be set up this way, but it’s quite complicated, so hence why Next.js exists, it’s a framework for making React apps that way. Edit: and note that it’s also good for making static sites, because you don’t need to load in any JS, you can just render HTML on the server.
Gatsby and Next.js are frameworks built on top of React.
Yeah, there’s also this thing called html or php for small websites
Funny you should mention PHP because Next.js feels very similar to it (there is nothing new in the world…)
Yeah? I have been dabbling with the dark side lately–Wordpress, php–just got Docker/Sail/Laravel loaded up on my computer today.