Hey, @nikgraf , thanks for the updated react connector! I was mucking around with useY in Next and got this error from useSyncExternalStore(_, _, getServerSnapshot). According to react docs it seems to stem from the mutability of the return data from that parameter.
(https://react.dev/reference/react/useSyncExternalStore#im-getting-an-error-the-result-of-getsnapshot-should-be-cached)
This can be avoided by bypassing SSR but I found that using
() => {
const data = yData.toJSON();
if (equalityDeep(prevDataRef.current, data)) {
return prevDataRef.current;
} else {
prevDataRef.current = data;
return prevDataRef.current;
}
}
For both parameters was able to work with SSR.
Hey, @nikgraf , thanks for the updated react connector! I was mucking around with useY in Next and got this error from useSyncExternalStore(_, _, getServerSnapshot). According to react docs it seems to stem from the mutability of the return data from that parameter.
(https://react.dev/reference/react/useSyncExternalStore#im-getting-an-error-the-result-of-getsnapshot-should-be-cached)
This can be avoided by bypassing SSR but I found that using
For both parameters was able to work with SSR.