margelo / react-native-skottie

▶️ Efficient lottie animations using Skia's Skottie module
https://margelo.io
MIT License
868 stars 24 forks source link

Can't turn Skottie into an animated component via `Reanimated.createAnimatedComponent()` #51

Open TowhidKashem opened 4 months ago

TowhidKashem commented 4 months ago

The following code:

    import Reanimated from 'react-native-reanimated';

    const AnimatedSkottieView = Reanimated.createAnimatedComponent(Skottie);

    <AnimatedSkottieView
      ref={scottieRef}
      source={require('assets/animations/hello-world.json')}
      style={{
        width: 250,
        height: 250
      }}
    />

results in the following error:

Error: Argument appears to not be a ReactComponent. Keys: play,pause,reset

Would be cool if we could turn it into an animated component to do things like making it hover, pulsate and other subtle animations on the component itself. Aside from that the component is working great, super smooth transition from react-native-lottie, thanks!