mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
d0f48c87bc
commit
74c9ef8fde
@@ -218,7 +218,6 @@ class Modal extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.setState({isRendered: false});
|
||||
if (this._eventSubscription) {
|
||||
this._eventSubscription.remove();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user