classFadeInViewextendsReact.Component { state = { fadeAnim:newAnimated.Value(0),// Initial value for opacity: 0 }componentDidMount() {Animated.timing( // Animate over timethis.state.fadeAnim,// The animated value to drive { toValue:1,// Animate to opacity: 1 (opaque) duration:10000,// Make it take a while } ).start(); // Starts the animation }render() {let { fadeAnim } =this.state;return ( <Animated.View// Special animatable Viewstyle={{...this.props.style, opacity: fadeAnim,// Bind opacity to animated value }} > {this.props.children} </Animated.View> ); }}