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.
Bumps nextjs example to latest version (does not reproduce the issue)
It seems that this issue is spawned by the
useSyncExternalStoreWithSelector
is initialized withgetServerSnapshot
set to an object, when a function is expected - because thegetServerState
(fromcreateStore()
) returns the initial state directly.I've refactored this, to set the
getServerSnapshot
equal to thegetState
method from the store. As I no longer see the need for thegetServerState
(fromcreateStore()
), I've removed it.nextjs-ssr
example (reproduces the issue)related to #822