-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I am using react18, do I still need loadable-components #994
Comments
You want them to hold hydration before rendering. This is not a "requirement" for SSR right now, but Suspense will trigger loading state dropping any context inside in case of any external update - facebook/react#22692 For situations like this you might still need orchestration provided by loadable or similar solution. |
@theKashey, what do you mean by "hold hydration before rendering"? |
There is no need to use loadable for client side dynamic imports. Absolutely no need since you have React.lazy working better and out of the box. loadableReady(() => {
const root = document.getElementById('main')
hydrate(<App />, root) // <-- delayed
}) |
Thanks for the detailed explanation, @theKashey |
You can think so. This is a piece of functionality not covered by React.Lazy and the one you still need around. |
@theKashey Thank you for your answer, now I know what I need to do. |
loadable-components
Loadable Components is meant to make React code splitting easy.
However, react 18 has
Suspense
working on the server side now. Then what are the cases where we still need to useloadable-components
?The text was updated successfully, but these errors were encountered: