Replies: 2 comments 5 replies
-
This is an excellent question. My elements were not taking the 2nd value assigned, and now I think it's because of this. I was just reading the discussions. Were you able to find a solution to this? |
Beta Was this translation helpful? Give feedback.
4 replies
-
Did you guys figure it out after all? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Reanimated 2 to build a game with React Native its performance is incredibly good but I have a problem.
I am using a shared value to animate a View as we all know setting the value of the shared value will automatically change the style of the View, my problem is that let's say it will be a Button that the user presses to give the View an elevation simply by changing a shared value used in the animated style of The View, the elevation is simply translation in the y axis.
The elevation value is 0 at first. The user clicks the button the value changes to for example 500 immediately with no transition and no animation, the View will immediately show at 500 above its starting position. And from 500 the View will drop back to 0 with animation. I tried the code below but no help.
when pressing the button the view doesn't move, it seems that Reanimated skips the first elevation.value assignment, and since the second assignment is to 0 (the same old value) the View doesn't move.
P.S. Animated.View is imported from Reanimated 2 and used. I left it out for simplicity.
Beta Was this translation helpful? Give feedback.
All reactions