An open API service indexing awesome lists of open source software.

https://github.com/only-icesoul/reanimatedpainter


https://github.com/only-icesoul/reanimatedpainter

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Reanimated Painter

Make sure you have reanimated and [Painter](https://github.com/Only-IceSoul/react-native-painter) installed

## Getting started

`$ yarn add reanimated-painter`

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

const theta = useSharedValue(0)

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

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

```