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
Hi, i have a question about basic client side loadable function behavior for SPA, when the chunk has been already loaded and we try to render it again.
So imagine.
we move to our page where the lazy component should be rendered. The loader is rendered, the chunk is loaded and the component is rendered;
we leave the page where the lazy component was rendered. And then go back to this page, expecting the lazy component to be rendered immidiately. But instead it renders the loader first, and only then the actual lazy component.
So i analyzed the source code, and i have found out that the 'loading' state is always true at first.
So the question is -> is it possible to somehow change this behavior by current library functionality so the component would be rendered immidiately (without loader) if the chunk was loaded before?
The text was updated successfully, but these errors were encountered:
Yes, it is possible and quite easy
Technically this.state.loading is a no longer used property and we should rely on cache state, like it already does for "suspense" components. However it also relies on the loading state that is not always in sync
@theKashey, so i have used lazy method, (even tried with hardcoded cachedKey as option), but it still do the first render with loading=true props, which leads to render a 'null' fallback in my case, which leads to the jumping page when second render comes with a loading=false. It means we still need a PR here for that?
Hi, i have a question about basic client side loadable function behavior for SPA, when the chunk has been already loaded and we try to render it again.
So imagine.
So i analyzed the source code, and i have found out that the 'loading' state is always true at first.
So the question is -> is it possible to somehow change this behavior by current library functionality so the component would be rendered immidiately (without loader) if the chunk was loaded before?
The text was updated successfully, but these errors were encountered: