Optimistically re-render non deferred parts when using deferred content after initial load #8508
JorritSalverda
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using
defer
,Suspense
andAwait
works beautifully for first load or when a component gets unmounted and remounted again. But when changing some props on the same route through navigation - with pagination for example - all re-rendering waits for the deferred content to be ready.The example below shows this very nicely in that before the initial deferred content is loaded and the fallback is still visible you can quickly use prev/next and the page number between those links immediately updates. Once the suspended fallback is replaced by the actual content using prev/next will wait for the deferred content to be ready before re-rendering the pagination. This leads to a suboptimal experience for the end user.
Is there anything that can be done to have the pagination stay responsive after the deferred content is loaded? I know it can be done with state, but then all links need an
onClick
handler. And it doesn't seem to automatically cancel the outstanding promises.Beta Was this translation helpful? Give feedback.
All reactions