()
| 41 | } |
| 42 | |
| 43 | componentDidUpdate() { |
| 44 | Animated.timing(this.visibility, { |
| 45 | toValue: this.props.visible ? 1 : 0, |
| 46 | duration: 300, |
| 47 | useNativeDriver: true, |
| 48 | isInteraction: false, |
| 49 | }).start(() => { |
| 50 | if (this.props.visible !== this.state.visible) { |
| 51 | setTimeout(() => { |
| 52 | this.mounted && this.setState({ visible: this.props.visible }); |
| 53 | }, 500); |
| 54 | } |
| 55 | }); |
| 56 | } |
| 57 | |
| 58 | render = () => { |
| 59 | const { style, children, ...rest } = this.props; |