Fix dismissal on the Old Architecture#42975
Closed
cipolleschi wants to merge 1 commit into
Closed
Conversation
ff2ed51 to
df38287
Compare
Base commit: 59c5edf |
Summary: The recent change to make onDismiss work on Fabric broke the Modal on Paper (see [this comment](https://www.internalfb.com/diff/D52959996?dst_version_fbid=236415652884499&transaction_fbid=896066412296150)). This change will fix that behavior. The problem was that we were resetting the `isRendered` state only when the Modal receives the event from the Event emitter AND if it has the `onDismiss` callback set. However, we should hide the component in any case if the ids match, and invoke the onDismiss if it is set. ## Changelog [iOS][Fixed] - Make sure that Modal is dismissed correctly in Paper Reviewed By: janeli-100005636499545 Differential Revision: D53686165
df38287 to
3f302a1
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D53686165 |
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Aug 26, 2024
Summary: Changelog: [internal] facebook#42975 added some logic to fix modal on iOS for Paper but introduced a state update in `componentWillUnmount`. Doing this is incorrect and we've seen cases where it leads to forcing passive effects synchronously, which can affect performance. This removes that unnecessary call to update the state, because the component will be unmounted anyway. Reviewed By: bgirard Differential Revision: D61813988
facebook-github-bot
pushed a commit
that referenced
this pull request
Aug 26, 2024
Summary: Pull Request resolved: #46218 Changelog: [internal] #42975 added some logic to fix modal on iOS for Paper but introduced a state update in `componentWillUnmount`. Doing this is incorrect and we've seen cases where it leads to forcing passive effects synchronously, which can affect performance. This removes that unnecessary call to update the state, because the component will be unmounted anyway. Reviewed By: bgirard Differential Revision: D61813988 fbshipit-source-id: bb203578376d86a907544fa62a0d04e93ca132ef
This file contains hidden or 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
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:
The recent change to make onDismiss work on Fabric broke the Modal on Paper (see this comment).
This change will fix that behavior.
The problem was that we were resetting the
isRenderedstate only when the Modal receives the event from the Event emitter AND if it has theonDismisscallback set.However, we should hide the component in any case if the ids match, and invoke the onDismiss if it is set.
Changelog
[iOS][Fixed] - Make sure that Modal is dismissed correctly in Paper
Differential Revision: D53686165