-
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] Unmounting a suspended class component #13925
Conversation
Previously we assumed any mounted class component would have an instance, but that's not the case for classes that suspend outside of Concurrent mode.
@@ -495,7 +495,10 @@ function commitUnmount(current: Fiber): void { | |||
case ClassComponent: { | |||
safelyDetachRef(current); | |||
const instance = current.stateNode; | |||
if (typeof instance.componentWillUnmount === 'function') { | |||
if ( |
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.
Comment pls?
Is that the only case that can bite us? |
@gaearon Probably not, can't be sure. This category of bug related to committing fibers that didn't actually complete — it's an intentional deviation from our model, to support Suspense outside Concurrent mode. So I wouldn't be shocked if we found more. |
This doesn't make sense to me. I thought they could all go to indeterminate mode. I don't want to go hunt down adding special cases in the code that we'll have to remove again. |
@sebmarkbage Classes don't use the indeterminate tag, except module-style components. That's probably a better way to fix it, though — a special tag that indicates the fiber is incomplete. Are you ok with landing this in the meantime to unblock the release? |
I'm worried about this not being the last one. |
Ok I'll open a different PR that adds a new type of work, |
Details of bundled changes.Comparing: 4947fcd...9b2eca0 scheduler
Generated by 🚫 dangerJS |
Previously we assumed any mounted class component would have an instance, but that's not the case for classes that suspend outside of Concurrent mode.