Skip to content

Fix dismissal on the Old Architecture#42975

Closed
cipolleschi wants to merge 1 commit into
facebook:mainfrom
cipolleschi:export-D53686165
Closed

Fix dismissal on the Old Architecture#42975
cipolleschi wants to merge 1 commit into
facebook:mainfrom
cipolleschi:export-D53686165

Conversation

@cipolleschi
Copy link
Copy Markdown
Contributor

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 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

Differential Revision: D53686165

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Feb 12, 2024
@cipolleschi cipolleschi force-pushed the export-D53686165 branch 6 times, most recently from ff2ed51 to df38287 Compare February 13, 2024 16:19
@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Feb 13, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,251,038 +3
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 20,613,461 +14
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 59c5edf
Branch: main

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
@facebook-github-bot
Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants