From 43338bc85d716dc4170f902523939eb5dd24cb39 Mon Sep 17 00:00:00 2001 From: Love Akinlesi Date: Fri, 2 Sep 2022 15:15:17 +0100 Subject: [PATCH] Update datepicker.js Specify the useNativeDriver option explicitly as false on Animated.timing() as required by warning. Refer to [Animated doc](https://reactnative.dev/docs/animated). Solving this raises another warning. So rename componentWillReceiveProps to componentDidUpdate as neither [componentWillReceiveProps nor UNSAFE_componentWillReceiveProps is not advised by react due to bugs and inconsistencies](https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops). --- datepicker.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datepicker.js b/datepicker.js index ac6cacde29..9823e28256 100644 --- a/datepicker.js +++ b/datepicker.js @@ -50,7 +50,7 @@ class DatePicker extends Component { this.setModalVisible = this.setModalVisible.bind(this); } - componentWillReceiveProps(nextProps) { + componentDidUpdate(nextProps) { if (nextProps.date !== this.props.date) { this.setState({date: this.getDate(nextProps.date)}); } @@ -66,7 +66,8 @@ class DatePicker extends Component { this.state.animatedHeight, { toValue: height, - duration: duration + duration: duration, + useNativeDriver: false } ).start(); } else { @@ -74,7 +75,8 @@ class DatePicker extends Component { this.state.animatedHeight, { toValue: 0, - duration: duration + duration: duration, + useNativeDriver: false } ).start(() => { this.setState({modalVisible: visible});