https://github.com/only-icesoul/reanimatedpainter
https://github.com/only-icesoul/reanimatedpainter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/only-icesoul/reanimatedpainter
- Owner: Only-IceSoul
- Created: 2021-11-14T00:26:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-14T00:38:54.000Z (over 3 years ago)
- Last Synced: 2025-02-23T22:37:28.778Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)})
},[])
}
```