Skip to content

Commit c37d813

Browse files
committed
fix(modal): fix onDismiss logic for the modal component on iOS
1 parent d898574 commit c37d813

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Libraries/Modal/Modal.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,10 @@ class Modal extends React.Component<Props> {
169169
};
170170
}
171171

172-
componentWillUnmount() {
173-
if (this.props.onDismiss != null) {
172+
UNSAFE_componentWillReceiveProps(nextProps: Props) {
173+
if (!nextProps.visible && this.props.visible && this.props.onDismiss) {
174174
this.props.onDismiss();
175175
}
176-
}
177-
178-
UNSAFE_componentWillReceiveProps(nextProps: Props) {
179176
Modal._confirmProps(nextProps);
180177
}
181178

0 commit comments

Comments
 (0)