Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Interactive Workshop
Walk through building a minimal static site generator using renderToStaticMarkup — from an empty directory to rendered HTML on disk, with no bundler or Babel needed.
Initialize with "type": "module" so you can use ES import syntax in Node.js. Install React and react-dom — that is all you need for a basic SSG pipeline.
1{
2 "name": "ssg",
3 "type": "module",
4 "scripts": {
5 "build": "node build.js"
6 },
7 "dependencies": {
8 "react": "^19.0.0",
9 "react-dom": "^19.0.0"
10 }
11}ssg-buildbuildSimulate "npm run build" — see the final dist/index.html output.
compareSee the difference between renderToStaticMarkup and renderToString output.