use-persisted-state
use-persisted-state copied to clipboard
SSR fails in nextjs
I think the issue is that window
is undefined.
I tried to find a solution here but I was getting an error about max depth updates. Some kind of circular loop. When I removed this package, it went away.
The error was:
Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
I'm on a deadline at the moment so can't look into it further, and apologies, this is really 2 topics in 1 issue, feel free to close without comment as I realise it's not super helpful without a reproduction, etc.
Thanks, I will investigate it a bit later