nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

Has anyone tried react-navigation ServerContainer rendering as SPA in next? #104

Closed tonyxiao closed 2 years ago

tonyxiao commented 2 years ago

New to this, got a Expo web app and want to do static / server side rendering and experimenting.

has anyone seen the following approach? It seems to work ok in a mini-test app but I'm not certain if anyone else tried it before.

image
nandorojo commented 2 years ago

that approach will actually break react hydration. the server and client need to render the same thing at the first render

tonyxiao commented 2 years ago

Hmm isn't server-container designed to solve this problem, with or without next.js? Where would the hydration delta come from?

nandorojo commented 2 years ago

For what it's worth, with Solito, you don't use react navigation on Web, so this approach wouldn't apply to the Solito architecture.