You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
withSingle SSR can sometimes be broken, especially when using the SmartForm in edition mode. One side renders a loader, while the other directly prints the form filled with data.
This could be related to either the server fetching the data before rendering (so the server renders the form but the client refetch the data and renders a loader) OR the client never showing the loader when data is cached (so server renders a loader and client renders a form), which is more probable.
I have not yet investigated this deeply so I can't tell which side renders what. I'll try to provide a minimal repro but this is should not be hard to reproduce in any app, just use a SmartForm that takes it's documentId from the route for example. If there is no issue, try wrapping it with another withSingle so the data is already cached when the form renders.
Most of the time it's not a big deal but you can get ugly result when rehydratation fails.
I did not found a satisfying solution either:
I can wrap the SmartForm with NoSsr in my app to quickfix
we could force withSingle to always render the loader at least once. Sounds a bit dirty...
there might be SSR features/packages I don't know about specifically built for this kind of issue? After all this can be common for any React component that fetches potentially cached data.
The text was updated successfully, but these errors were encountered:
Hi,
withSingle
SSR can sometimes be broken, especially when using the SmartForm in edition mode. One side renders a loader, while the other directly prints the form filled with data.This could be related to either the server fetching the data before rendering (so the server renders the form but the client refetch the data and renders a loader) OR the client never showing the loader when data is cached (so server renders a loader and client renders a form), which is more probable.
I have not yet investigated this deeply so I can't tell which side renders what. I'll try to provide a minimal repro but this is should not be hard to reproduce in any app, just use a SmartForm that takes it's documentId from the route for example. If there is no issue, try wrapping it with another
withSingle
so the data is already cached when the form renders.Most of the time it's not a big deal but you can get ugly result when rehydratation fails.
I did not found a satisfying solution either:
withSingle
to always render the loader at least once. Sounds a bit dirty...The text was updated successfully, but these errors were encountered: