esta es mi interfaz
interface FloatingLabelState { paddingAnim: Animated.Value; opacityAnim: Animated.Value; useNativeDriver :boolean; }
Esta es mi función componentWillReceiveProps
componentWillReceiveProps(newProps: FloatingLabelProps) { Animated.timing(this.state.paddingAnim, { toValue: newProps.visible ? 5 : 9, duration: 230, useNativeDriver:this.state.useNativeDriver }).start(); return Animated.timing(this.state.opacityAnim, { toValue: newProps.visible ? 1 : 0, duration: 230, useNativeDriver:this.state.useNativeDriver }).start(); }
Con muchos recursos, me di cuenta de que getDerivedStateFromProps() estático sería una alternativa. ¿Puede alguien ayudarme a convertir el componenteWillReceiveProps en el método getDerivedStateFromProps?