I create a Custome Component With these props:
opacity: PropTypes.number,// opacity;
In one page I use this to make it support animate.
constAnimatedProgress=Animated.createAnimatedComponent(RecorderProgress);
then , I set a percentage state.
this.state={_opacity: newAnimated.Value(0)}and set a animate in componentDidMount;
Animated.timing(this.state._opacity,{toValue:1,// no-transparent;duration:5000}).start();add the component to page:
<AnimatedProgressopacity={opacity:this.state._opacity}/>But when I run the app, there is no animation of the component.
I also found that if I create a opacity in style of the component directly, the animation works.
<AnimatedProgressstyle={{opacity:this.state._opacity}}/>Please it's very confused me, is there any one who can help me?Thanks.
I create a Custome Component With these props:
In one page I use this to make it support animate.
then , I set a percentage state.
and set a animate in componentDidMount;
add the component to page:
But when I run the app, there is no animation of the component.
I also found that if I create a opacity in style of the component directly, the animation works.
Please it's very confused me, is there any one who can help me?Thanks.