Open jzhan-canva opened 3 weeks ago
Sounds similar to the issues I have been having https://github.com/facebook/react/issues/31099
Hi @edqwerty1 yes it's very similar, but my case is client side rendering without SSR/hydration. and I saw someone suggested unstable_scheduleHydration
in your issue as it can help prioritise a suspense boundary during hydration. Unfortunately I didn't find anything for rendering so I decided to create a new issue
Summary
React Version: 18.2.0 (also tested in 19 RC)
After transitioning from the legacy renderer to the concurrent renderer, we've encountered an issue with render delays when using
React.lazy
to lazily load a sub-application. This sub-app is a crucial component of our UI, and without it, the page is essentially non-functional.Business Context
As illustrated in the diagram below, the sub-app occupies the majority of the page. Currently, server-side rendering is not implemented for this page, so it relies on client-side rendering to determine which sub-app should be lazy-loaded.
The sub-app is the most crucial component of this page. Therefore, once the
import()
resolves, we'd like to prioritize rendering this component over any other task.Given that this page is a large-scale product involving many engineers, transitioning to SSR is a challenging task.
Steps To Reproduce
Investigation Findings
requestRetryLane
.flushSync
to prioritize rendering does not affectrequestRetryLane
, preventing us from prioritizing the lazy component for mounting inSyncLane
.Question/Request
Could we have an option to prioritize specific
React.lazy
or Suspense components? Prioritizing our sub-app component is crucial because of its essential role in our page's functionality and performance needs.We look forward to any insights, workarounds, or plans for this kind of prioritization feature in React.
Thank you for your continued efforts in improving React and for your support.