Closed jasonlor closed 5 years ago
I'm not sure what you mean, exactly.
Static mode, by definition, means that the output being produced includes:
index.html
, used to bootstrap...In this context, there's nothing to hydrate because index.html
doesn't contain any rendered React HTML. It contains an empty <div id="root">
where it will render the client-side React.
If you are foregoing the index.html and using your own backend, this placing your own SSR content inside of <div id="root">
will have the same affect. However, it would need to match the generated .js exactly, or you'll get errors that the content doesn't match.
If I'm missing the point and you mean something else, please provide some more detail. I'm not clear how you're expecting this to work.
Hey there!
Is it possible to hydrate in static mode? The only reference I was able to find is I want to leverage a different backend than Koa and SSR render the data from the server.
ReactDOM[root.innerHTML ? "hydrate" : "render"] in client.tsx