-
Notifications
You must be signed in to change notification settings - Fork 49.9k
React.lazy constructor must return result of a dynamic import #13886
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
Conversation
Details of bundled changes.Comparing: d9659e4...4a5f5cc scheduler
Generated by 🚫 dangerJS |
|
I am confused why this is linked to my issue? |
|
@sebastiankemp Copypasta |
20897b0 to
b570815
Compare
d983636 to
c91cb61
Compare
|
If this is just for Component(from the codes and naming like |
c91cb61 to
dadd169
Compare
We may want to change the protocol later, so until then we'll be restrictive. Heuristic is to check for existence of `default`.
dadd169 to
4a5f5cc
Compare
|
Doesn't this make the case of importing a lazy component that isn't a module's default export a bit less obvious? Before const FooComponent = React.lazy(() =>
import("component-library").then(module => module.FooComponent)
);After const FooComponent = React.lazy(() =>
import("component-library").then(module => ({
default: module.FooComponent
}))
); |
|
Why not check for |
|
Please comment on the RFC if you have feedback. It contains the motivation and more details: reactjs/rfcs#64 |
Fixes a bug where a lazy component does not cache the result of its constructor.
Fixes a bug where a lazy component does not cache the result of its constructor.
Fixes a bug where a lazy component does not cache the result of its constructor.
…ok#13886) We may want to change the protocol later, so until then we'll be restrictive. Heuristic is to check for existence of `default`.
Fixes a bug where a lazy component does not cache the result of its constructor.
…ok#13886) We may want to change the protocol later, so until then we'll be restrictive. Heuristic is to check for existence of `default`.
Fixes a bug where a lazy component does not cache the result of its constructor.
Based on #13885
We may want to change the protocol later, so until then we'll be restrictive. Heuristic is to check for existence of
default.See #13885 for more details.