-
Notifications
You must be signed in to change notification settings - Fork 45.9k
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
Named imports in lazy feature #14390
Comments
Looks like it's not yet available
I think that's the only solution for now |
This is how I do it. const Contacts = React.lazy(() =>
import('./Contacts.js').then(module => ({ default: module.Contacts }))
); |
@TrySound Thank you for that. Still we need to import every component separately though. |
@barth12 yeah, that's the one big caveat with how Closing since this is a documented shortcoming and expected behavior for now. |
I try with this ->
It works fine! |
Hi guys,
How could I import named imports using lazy syntax?
Before we could use
import { MainComponent, Component1, Component2 } from './components';
How to achieve something like this (although this does not work)?:
const { MainComponent, Component1, Component2 } = React.lazy(() => import('./components'));
Thank you and have a good day :-)
The text was updated successfully, but these errors were encountered: