Remove incorrect state update during unmount in Modal (#46218)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46218

Changelog: [internal]

https://github.com/facebook/react-native/pull/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 commit is contained in:
Rubén Norte
2024-08-26 15:54:18 -07:00
committed by Facebook GitHub Bot
parent d0f48c87bc
commit 74c9ef8fde
-1
View File
@@ -218,7 +218,6 @@ class Modal extends React.Component<Props, State> {
}
componentWillUnmount() {
this.setState({isRendered: false});
if (this._eventSubscription) {
this._eventSubscription.remove();
}