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
I understand that on page revalidations (e.g. user submits a POST request) the Suspense fallback will not render and instead you get the pending UI (as per https://reactrouter.com/6.28.0/guides/deferred#when-does-the-suspense-fallback-render). However, does it also mean that the data is not streamed on page revalidations and only returns when the loader has finished awaiting all data?
I can see that on the initial page load both fallbacks and then typically the table will resolve faster (and render first) before the dashboard. On page revalidations I don't see the fallbacks (this is expected as per the documentation) but the table and the dashboard components will re-render at the same time leading me to believe that defer on page revalidations is working like a regular json return and awaits all pending promises to resolve before re-rendering both components at the same time.
Is this expected behavior? I was hoping that also on page revalidations the the components would get re-rendered as soon as their data became available and not when the slowest data resolves and re-rendering everything together.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I understand that on page revalidations (e.g. user submits a POST request) the Suspense fallback will not render and instead you get the pending UI (as per https://reactrouter.com/6.28.0/guides/deferred#when-does-the-suspense-fallback-render). However, does it also mean that the data is not streamed on page revalidations and only returns when the loader has finished awaiting all data?
Currently my loader returns:
where both dashLoaderData and tableLoaderData are promises.
and then in the component:
I can see that on the initial page load both fallbacks and then typically the table will resolve faster (and render first) before the dashboard. On page revalidations I don't see the fallbacks (this is expected as per the documentation) but the table and the dashboard components will re-render at the same time leading me to believe that defer on page revalidations is working like a regular json return and awaits all pending promises to resolve before re-rendering both components at the same time.
Is this expected behavior? I was hoping that also on page revalidations the the components would get re-rendered as soon as their data became available and not when the slowest data resolves and re-rendering everything together.
Beta Was this translation helpful? Give feedback.
All reactions