-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withSpring is behaving weirdly #1804
Comments
Issue validatorThe issue is invalid!
|
I've also noticed issues with |
@nandorojo If you want I can host a demo, I already have a custom setup for the web handy |
Could you create/share a reproduction of that issue? Minimal GitHub repos are fine if snack doesn't work |
Here's the hosted preview Repro steps
You will notice after completing the animation it goes to some arbitrary value. Let me know if there's an issue with my implementation |
@pranshuchittora This is related to |
Thanks |
@piaskowyk thanks! I'm already on RNW 14, so that solution unfortunately won't work for me. Do you have an idea of when this might be resolved? |
@nandorojo I debugged this today and I found a reason - this isn't problem with |
That looks right, thanks for taking the time. I believe setNativeProps is going to get deprecated in the future. Is there an alternative? See fixes: https://github.com/necolas/react-native-web/releases?after=0.13.4 |
Just found out that setting |
@pranshuchittora Great to know. Do you have a video/example showing the difference, by chance? |
@nandorojo you can replicate the same over here -> https://reanimated.funcs.io/ |
Can we re-open this issue? While Once react-native-web merges necolas/react-native-web#1939, it should be good to close. |
If anyone is coming here from Moti, I added relevant docs here with this commit. |
My PR for |
I upgraded to RNW 0.15.3, (the patch was in 0.15.2) but my |
Hi @nandorojo , I just upgraded the deps and it's working perfectly. "react-native": "^0.64.0",
"react-native-reanimated": "^2.1.0",
"react-native-web": "^0.15.5", For demo -> https://reanimated.funcs.io/#/reanimated/dimensions |
`transform` animation value is not preserved between render on mobile. This is the reason that `scale` is return to origin when writing a text on `textInput` which invokes `re-render`. So I changed animation value from `scale` to `width` and `height`. But there is a bug about `withSpring` function on `web`, then I splits an animation value according to platform. This bug seems to have related with `react-native-web`. You can check relate issue with [here](software-mansion/react-native-reanimated#1804) or [here](necolas/react-native-web#1935).
`transform` animation value is not preserved between render on mobile. This is the reason that `scale` is return to origin when writing a text on `textInput` which invokes `re-render`. So I changed animation value from `scale` to `width` and `height`. But there is a bug about `withSpring` function on `web`, then I splits an animation value according to platform. This bug seems to have related with `react-native-web`. You can check relate issue with [here](software-mansion/react-native-reanimated#1804) or [here](necolas/react-native-web#1935).
Description
I am trying to use withSpring to animate the height and width. After completing the animation it's going to some weird values.
Screenshots
The box with the dashed border is the expected size, after completing it's going to some unexpected values.
Steps To Reproduce
It should work as expected. I tried using withTiming and it's working as expected on withSpring is behaving weirdly.
Snack or minimal code example
Snack is not allowing to install Reanimated v2 :(
Package versions
Edit
Here's the hosted preview
https://affectionate-perlman-8d974a.netlify.app/
Repro steps
You will notice after completing the animation it goes to some arbitrary value.
And here's the code -> https://github.com/funcsio/reanimated-web-setup
Let me know if there's an issue with my implementation
The text was updated successfully, but these errors were encountered: