Closed kylegillen closed 3 years ago
Can you see what happens with rc.0?
My bad. It does work with rc.0. Thanks.
It looks like they just released 2.0.0 stable though https://github.com/software-mansion/react-native-reanimated/releases/tag/2.0.0
Should work with stable.
I just installed reanimated 2.0.0 , i have the same problem , changing state has no effect but it works when i use useAnimationState
Hmm, I wonder if reanimated is enforcing a dependency array more strongly in later versions.
Does useAnimatedStyle
from reanimated 2 work with state changes? Or do you need to use the dependency array?
Does
useAnimatedStyle
from reanimated 2 work with state changes? Or do you need to use the dependency array? It should. Dependencies here may be: undefined(argument skipped) - worklet will be rebuilt if there is any change in it's body or any values from it's closure(variables from outer scope used in worklet),
I have the same issue, is there a fix?
I can get to this when expo releases SDK 41 with v2 support. If someone using v2 stable could figure out the answer to my question above, it'd make it a lot easier.
My hunch is that there's a dependency array addition, and Moti isn't using the dependency array.
useAnimatedStyle just instantly crashes the app for me, with or without dependency array.
When using reanimated directly, or just with Moti?
reanimated directly
Could you open an issue there and link it to this one?
Are you sure you followed the instructions and have the Babel plugin?
I think this https://github.com/software-mansion/react-native-reanimated/pull/1660 is the change that's causing the issue. The shared value will now stay the same even when we pass a new initial value to useSharedValue
(this is similar to useState
).
I think this software-mansion/react-native-reanimated#1660 is the change that's causing the issue. The shared value will now stay the same even when we pass a new initial value to
useSharedValue
(this is similar touseState
).
So is there a solve to this yet? Or a way to circumvent it. because i really need animation based on change in state.
I'll investigate this.
Please try this:
yarn add moti@next
It should install 0.6.2
which has the fix. Please confirm here that it works.
Yes, it is working now, thanks a bunch ❤️.
On Sat, 13 Mar, 2021, 9:00 pm Fernando Rojo, @.***> wrote:
Please try this:
yarn add @.***
It should install 0.6.2 which has the fix. Please confirm here that it works.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nandorojo/moti/issues/30#issuecomment-798513647, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZ2HHZROGEZ74IPV2RTJFTTDNZHPANCNFSM4YT7RRHA .
Thanks a lot!
Published to latest
version in 0.6.4: yarn add moti
.
Hi @nandorojo background color is notupdating in Moti view
This is a reanimated bug. I already opened an issue https://github.com/software-mansion/react-native-reanimated/issues/2751
translateX is working based on the state change but backgroundColor and color properties are not working @nandorojo could you please help
I just answered your question.
Thanks @nandorojo
Hi. I'm following along with the documentation, and there's an example that reads:
<View animate={{ opacity: isLoading ? 1 : 0 }} />
I've got the following code which has a button that toggles a piece of state, and a box that should fade in / out — the state is changing but the animation is not, neither on simulator nor device.
Am I doing this the correct way?