React-native-vector-icons: Animate a generic icon

Created on 12 Jan 2018  路  2Comments  路  Source: oblador/react-native-vector-icons

@oblador :

Hi, how can you animate a generic icon by not specifying the Bundled Icon Sets.
For example, when this icon is applied a rotation from 0 to 360 deg.

      <TouchableNativeFeedback onPress={this.Refresh} delayPressIn={0} delayPressOut={0}>
        <Icon size={28} name="refresh" color="#fff"/>
      </TouchableNativeFeedback>

Most helpful comment

Yup, Animatable does the job and could also be done without a Animatable.View like this:

import * as Animatable from 'react-native-animatable';
const AnimatableIcon = Animatable.createAnimatableComponent(Icon);

All 2 comments

Use Animatable and enclose the Icon inside a Animatable.View

https://github.com/oblador/react-native-animatable

Yup, Animatable does the job and could also be done without a Animatable.View like this:

import * as Animatable from 'react-native-animatable';
const AnimatableIcon = Animatable.createAnimatableComponent(Icon);
Was this page helpful?
0 / 5 - 0 ratings