ctrlplusb / easy-peasy

Vegetarian friendly state for React
https://easy-peasy.dev
MIT License
5.03k stars 190 forks source link

bugfix: Nextjs SSR issues (fixes #822) #823

Closed jmyrland closed 1 year ago

jmyrland commented 1 year ago

It seems that this issue is spawned by the useSyncExternalStoreWithSelector is initialized with getServerSnapshot set to an object, when a function is expected - because the getServerState (from createStore()) returns the initial state directly.

I've refactored this, to set the getServerSnapshot equal to the getState method from the store. As I no longer see the need for the getServerState (from createStore()), I've removed it.

related to #822

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
easy-peasy ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2023 10:10am