A quick primer on how [[20220912120502-server-side-rendering]] works with [[react]].
The high level overview is:
ReactDOM.renderToString
ReactDOM.hydrate
, making it interactiveBy default [[node]] + Express has a few issues being a React SSR server. For one, the way it handles imports is different. A second issue is that it needs to handle JSX. There are a couple ways to solve this:
Since hydration needs the server and client code to match, this means you'll need to share an App
component (or similar) between them.
Remember by default the client bundle that is requested by the client is going to be large. Tools like [[20220911060950-code-splitting]] and [[20220912112727-lazy-loading]] help here.