Skip to content

Commit aefa112

Browse files
authored
ActionSheet - replace 'componentWillReceiveProps' with 'componentDidUpdate'. (#914)
1 parent b445a52 commit aefa112

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/actionSheet/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ export default class ActionSheet extends BaseComponent {
104104
message: undefined
105105
};
106106

107-
UNSAFE_componentWillReceiveProps(nextProps) {
107+
componentDidUpdate(prevProps) {
108108
const {useNativeIOS} = this.getThemeProps();
109-
const wasVisible = this.props.visible;
110-
const willBeVisible = nextProps.visible;
109+
const wasVisible = prevProps.visible;
110+
const willBeVisible = this.props.visible;
111111

112112
if (!wasVisible && willBeVisible && useNativeIOS && Constants.isIOS) {
113-
const {title, message, cancelButtonIndex, destructiveButtonIndex, options, showCancelButton} = nextProps;
113+
const {title, message, cancelButtonIndex, destructiveButtonIndex, options, showCancelButton} = this.props;
114114

115115
const optionsArray = options !== undefined ? options : [];
116116
let cancelBtnIndex = cancelButtonIndex;

0 commit comments

Comments
 (0)