react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Suggestion]: The official way to build a simple static generated website (SSG) without Next.js

Open stouch opened this issue 1 year ago • 1 comments

Summary

Improve docs about Static Site Generation (SSG)

Page

No response

Details

What is the official and easiest way to build a static-files generated website (with separate .html files) with React ?

I finally used https://github.com/Daydreamer-riri/vite-react-ssg which is very good, but I was quite surprised to not find anything clear way to do so in the docs.

(This part is not clear at all : https://react.dev/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022#static-server-rendering-optimizations) Capture d’écran 2024-09-10 à 17 36 16

stouch avatar Sep 10 '24 15:09 stouch

+1... This issue looks to me a major missing information in React documentation.

stouch avatar Oct 12 '24 07:10 stouch

Any news about this one ?

stouch avatar Nov 29 '24 12:11 stouch

I'm an experienced React dev who ended up here after spending an hour completely lost on how to achieve basic SSG so I'll echo that this is missing information

aheggie avatar Dec 17 '24 03:12 aheggie

Daydreamer-riri Riri has the official way with vite-react-ssg, as long as React does not improve the docs about this..

stouch avatar Dec 20 '24 08:12 stouch

Closed by https://github.com/reactjs/react.dev/pull/7626, along with https://github.com/reactjs/react.dev/pull/7495 and https://github.com/reactjs/react.dev/pull/7624. The easiest way is to use a framework that supports this, but if you choose to use a build tool and build this yourself, you'll need to consult the docs of the build tool you choose or build it yourself using the react-dom static APIs.

rickhanlonii avatar Feb 18 '25 01:02 rickhanlonii