Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native-reanimated not accepting rotation value in degrees

I'm learning reanimated because it works on the UI thread and I want to achieve a rotation animation. Rotating in degrees (like 45deg) is not working and prompts an error. So how can we achieve rotation animation in react-native-reanimation v1(version 1)?

like image 422
viki Avatar asked Oct 20 '25 02:10

viki


1 Answers

Probably you need concat function from reanimated library:

import Animated, { concat } from 'react-native-reanimated';
...
return (
  <Animated.View style={{
    transform: [{rotateZ: concat(yourAnimatedValue, 'deg')}],
  }}/>
);
like image 185
Aliaksei Avatar answered Oct 22 '25 03:10

Aliaksei



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!