import Icon from 'react-native-vector-icons/EvilIcons';
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
const App: () => React$Node = () => {
return (
<AnimatedIcon name="spinner-3" size={ 64 } />
);
};
Nothing happens. No idea why. React-Native documentation does not really help.
@yanickrochon
I try to change a simple example from website like this below. And it works!
Maybe this could help you a little :D ?
import Icon from 'react-native-vector-icons/EvilIcons';
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
class abc extends Component {
...
animVal = new Animated.Value(0);
animatedTransition = Animated.spring(this.animVal, { toValue: 1 })
interpolateIcon = this.animVal.interpolate({ inputRange: [0, 1], outputRange: [0, 1] })
componentDidMount() {
this.animatedTransition.start()
}
render(){
return(
<AnimatedIcon name="like" size={64} style={{ paddingLeft: 10, paddingRight: 10, transform: [{
scale: this.interpolateIcon }] }} /> );
}
}
Thank you @KaoPengHsiang !
Most helpful comment
Thank you @KaoPengHsiang !