This project uses just HTML, CSS, and JS. All are statically hosted on GitHub Pages. No need for Node to manage packages or run a build step.
Starter template using React on a website's frontend - without Node
Imports are done by URL, using the ES Modules approach.
import React from "https://email@example.com"; import ReactDOM from "https://firstname.lastname@example.org";
The browser will run the JS file and see that it needs React and then fetch React from CDN URL and then use it.
You get to load React directly in your JS script, by URL. Without having to manage dependencies as
script tags in HTML or having to manage a
This is no
npm command to run here.
Simply start a static HTTP server in the repo root, using your preferred options. See my Start a dev server guide for a few ideas.
If you use VS Code, then the Live Server extension works great.
This Frontend template is great for someone who has never used Node before but wants to get the benefit of React.
Even if you already use Node regularly, I would still recommend you have a look at the template's code and site,
Since when you understand how to run React without Node, you'll understand the purpose and benefits of Node. As well as the downsides - such as requiring the use of Node locally and in a build step, environment and compatibility issues, and requiring a strict structure of a Node app (which makes it hard to add React to an existing project that doesn't use Node).