-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Guard against unmounted components when accessing public instances on Fabric #27687
Merged
rubennorte
merged 1 commit into
facebook:main
from
rubennorte:guard-against-cleaned-up-fibers
Nov 10, 2023
Merged
Guard against unmounted components when accessing public instances on Fabric #27687
rubennorte
merged 1 commit into
facebook:main
from
rubennorte:guard-against-cleaned-up-fibers
Nov 10, 2023
+33
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rubennorte
changed the title
Guard against reset fibers when accessing public instances
Guard against unmounted components when accessing public instances on Fabric
Nov 10, 2023
javache
approved these changes
Nov 10, 2023
sammy-SC
approved these changes
Nov 10, 2023
Comparing: 0e352ea...2a68e01 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 13, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 13, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 14, 2023
…k#41451) Summary: After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455
facebook-github-bot
pushed a commit
to facebook/react-native
that referenced
this pull request
Nov 14, 2023
Summary: Pull Request resolved: #41451 After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455 fbshipit-source-id: 05de682d840eed7f22473800efe5fb910c8f3a0d
kodiakhq bot
pushed a commit
to vercel/next.js
that referenced
this pull request
Nov 15, 2023
### React upstream changes - facebook/react#27694 - facebook/react#27695 - facebook/react#27689 - facebook/react#27687 - facebook/react#27677 - facebook/react#27681
Othinn
pushed a commit
to Othinn/react-native
that referenced
this pull request
Jan 9, 2024
…k#41451) Summary: Pull Request resolved: facebook#41451 After [this change in React](facebook/react#27687), `ReactFabric.getPublicInstanceFromInternalInstanceHandle` can return `null` if the instance handle is a fiber that was unmounted (before that PR, it would throw an error). This modifies the DOM traversal API to gracefully handle that case. Changelog: [internal] Reviewed By: rshest Differential Revision: D51210455 fbshipit-source-id: 05de682d840eed7f22473800efe5fb910c8f3a0d
EdisonVan
pushed a commit
to EdisonVan/react
that referenced
this pull request
Apr 15, 2024
… Fabric (facebook#27687) ## Summary This fixes an error in `getPublicInstanceFromInstanceHandle` where we throw an error when trying to access the public instance from the fiber of an unmounted component. This shouldn't throw but return `null` instead. ## How did you test this change? Updated unit tests. Before: <img width="969" alt="Screenshot 2023-11-10 at 15 26 14" src="https://github.com/facebook/react/assets/117921/ea161616-2775-4fab-8d74-da4bef48d09a"> After: <img width="1148" alt="Screenshot 2023-11-10 at 15 28 37" src="https://github.com/facebook/react/assets/117921/db18b918-b6b6-4925-9cfc-3b4b2f3ab92d">
bigfootjon
pushed a commit
that referenced
this pull request
Apr 18, 2024
… Fabric (#27687) ## Summary This fixes an error in `getPublicInstanceFromInstanceHandle` where we throw an error when trying to access the public instance from the fiber of an unmounted component. This shouldn't throw but return `null` instead. ## How did you test this change? Updated unit tests. Before: <img width="969" alt="Screenshot 2023-11-10 at 15 26 14" src="https://github.com/facebook/react/assets/117921/ea161616-2775-4fab-8d74-da4bef48d09a"> After: <img width="1148" alt="Screenshot 2023-11-10 at 15 28 37" src="https://github.com/facebook/react/assets/117921/db18b918-b6b6-4925-9cfc-3b4b2f3ab92d"> DiffTrain build for commit 6b3834a.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This fixes an error in
getPublicInstanceFromInstanceHandle
where we throw an error when trying to access the public instance from the fiber of an unmounted component. This shouldn't throw but returnnull
instead.How did you test this change?
Updated unit tests.
Before:
After: