From 2ffd31bbd708548dd3b56ba17a9fcbd26a6b95f9 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Thu, 17 Oct 2024 22:09:43 -0700 Subject: [PATCH] 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 --- packages/react-native/Libraries/Modal/Modal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/Libraries/Modal/Modal.js b/packages/react-native/Libraries/Modal/Modal.js index 303e3ea3b9a..5f6f847568b 100644 --- a/packages/react-native/Libraries/Modal/Modal.js +++ b/packages/react-native/Libraries/Modal/Modal.js @@ -224,6 +224,9 @@ class Modal extends React.Component { } componentWillUnmount() { + if (Platform.OS === 'ios') { + this.setState({isRendered: false}); + } if (this._eventSubscription) { this._eventSubscription.remove(); }