-
Notifications
You must be signed in to change notification settings - Fork 47.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
[Synchronous Suspense] Suspending a class outside concurrent mode #13926
Conversation
When a class component suspends during mount outside concurrent mode, change the tag so it's not mistaken for a completed component. For example, we should not call componentWillUnmount if it is deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be classes IncompleteClassComponent if it's assumed to be a class.
@sebmarkbage Re: naming, I thought maybe this might be needed for other types in the future? But I suppose we'll rename it then. |
b2e52a9
to
e1300ef
Compare
// Typically, a component that mounted will have an instance. However, | ||
// outside of concurrent mode, a suspended component may commit without | ||
// an instance, so we need to check whether it exists. | ||
instance !== null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why do we still need this check? I thought the separate tag is supposed to address it.
@@ -762,7 +763,7 @@ function mountLazyComponent( | |||
renderExpirationTime, | |||
) { | |||
if (_current !== null) { | |||
// An indeterminate component only mounts if it suspended inside a non- | |||
// An lazy component only mounts if it suspended inside a non- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A* lazy
) { | ||
if (_current !== null) { | ||
// An incomplete component only mounts if it suspended inside a non- | ||
// concurrent tree, in an inconsistent state. We want to tree it like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to tree it
treat it?
ReactDOM: size: 🔺+0.3%, gzip: 🔺+0.3% Details of bundled changes.Comparing: 4947fcd...e1300ef react-dom
react-art
react-test-renderer
react-reconciler
react-native-renderer
scheduler
Generated by 🚫 dangerJS |
…cebook#13926) * [Synchronous Suspense] Suspending a class outside concurrent mode When a class component suspends during mount outside concurrent mode, change the tag so it's not mistaken for a completed component. For example, we should not call componentWillUnmount if it is deleted. * PR nits
…3926) * [Synchronous Suspense] Suspending a class outside concurrent mode When a class component suspends during mount outside concurrent mode, change the tag so it's not mistaken for a completed component. For example, we should not call componentWillUnmount if it is deleted. * PR nits
When a class component suspends during mount outside concurrent mode, change the tag so it's not mistaken for a completed component. For example, we should not call componentWillUnmount if it is deleted.