It’s giving " Unhandled Runtime Error Error: This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."
Removing Plasmic components and just rending <div>hi</div> is fine. Removing “use-local-storage-state” and just rendering Plasmic components is fine.
It seems to be specific to using an array for defaultValue in useLocalStorageState
However, when I comment out PlasmicRootProvider and use a basic
, it works. When I comment out useLocalStorageState and leave PlasmicRootProvider, it works. I cannot use both useLocalStorageState and PlasmicRootProvider and the same time.
As a quick fix, in Plasmic, we allow you to remove the React.Suspense by using the flags disableLoadingBoundary={true} and disableRootLoadingBoundary={true} in your <PlasmicRootProvider/> instance.
You should also not use the LoadingBoundary component in the Studio to avoid adding additional React.Suspense.
But there are some consequences to that. The main reason we have React.Suspense is to power Backend data integrations | Learn Plasmic usage in Plasmic projects. So, by disabling it, you may face unintended issues if you are using Plasmic data integrations to perform data fetching in your application. If you solely fetch data in SSG or SSR, it should be fine to disable it from your client.
This error seems to be visible in other combinations of hooks in a nondeterministic way, and it seems to have similar reasons as in the linked issue.