Skip to content

Commit

Permalink
set modal rendered state to false on unmount (facebook#47078)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#47078

Changelog: [Internal]

in fabric, we've found a scenario where this modal state update is required to cleanup all artifacts from the modal presentation views. it is safe to add this back, as it was originally removed for a scenario that no longer exists.

Reviewed By: shwanton

Differential Revision: D64388550

fbshipit-source-id: f13571260379554b0126c379ace9f9e1b81866be
  • Loading branch information
philIip authored and facebook-github-bot committed Oct 18, 2024
1 parent 0ba00fc commit 2ffd31b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react-native/Libraries/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ class Modal extends React.Component<Props, State> {
}

componentWillUnmount() {
if (Platform.OS === 'ios') {
this.setState({isRendered: false});
}
if (this._eventSubscription) {
this._eventSubscription.remove();
}
Expand Down

0 comments on commit 2ffd31b

Please sign in to comment.