Skip to content

Commit

Permalink
Remove incorrect state update during unmount in Modal (#46218)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rubennorte authored and facebook-github-bot committed Aug 26, 2024
1 parent d0f48c8 commit 74c9ef8
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/react-native/Libraries/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class Modal extends React.Component<Props, State> {
}

componentWillUnmount() {
this.setState({isRendered: false});
if (this._eventSubscription) {
this._eventSubscription.remove();
}
Expand Down

0 comments on commit 74c9ef8

Please sign in to comment.