set modal rendered state to false on unmount (#47078)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Phillip Pan
2024-10-17 22:09:43 -07:00
committed by Facebook GitHub Bot
parent 0ba00fc998
commit 2ffd31bbd7
+3
View File
@@ -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();
}