1.0.0 • Published 4 years ago

reanimated-painter v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Reanimated Painter

Make sure you have reanimated and Painter installed

Getting started

$ yarn add reanimated-painter

Usage

import AnimatedPainter, {getAnimatedProps } from 'reanimated-painter';
import Animated, {useAnimatedProps,useAnimatedReaction } from "react-native-reanimated";

  const theta = useSharedValue(0)

  const [animatedProps,setAnimatedProps] = getAnimatedProps<any>({
      //initial props web
  },useAnimatedProps(() => {
    return {
        //rotation
      rot: toDegrees(theta.value), 
    };
  }))

   if(Platform.OS === "web" ){
     useAnimatedReaction(()=>theta.value,(v)=>{
        runOnJS(setAnimatedProps!)({rot:toDegrees(v)})
     },[])
  }

      <AnimatedPainter.Circle
        animatedProps={animatedProps}
        />