You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that after rn-web v0.19, it is recommended to use space-separated string functions on web instead of array, as we get these deprecation warnings
though they work fine on web, but we can't apply animations using them as of now, as I'm getting this error even when using the styles without animation on any Animated component
Expected behavior
animation on these new string functions should work fine, as it is working in case of array transform right now.
Steps to reproduce
You can clearly see the issue in the attached sandbox.
For a bigger example, I had the issue when I was recently trying to fix these warning on this sample app (Web Demo), there are few places where I'm using these styles and they are working fine, but can't use them where animations are needed.
Currently I'm using ...Platform.select({ web : { transform: 'rotate(45deg)' } }) approach to apply these styles, as they don't yet seems to be cross compatible with native platforms.
Do let me know if there's any particular approach to apply animations here or if this is something to be fix in future version of the package.
Aashu-Dubey in the test case, you're trying to stringify an animated object:
web: { transform: `rotate(${rotate})` }
That will never work.
What you can do is interpolate the whole string value (which will work in RN), or animate only therotate property (which will work only on web for now)
I'll second the question from @Gregoirevda
I do not understand what the intended future-friendly implementation is for 2+ animated objects on a single Animated.View.
Activity
[-][Animation] Cannot animate string transform properties (v0.19)[/-][+][Animated] Cannot animate string transform properties (v0.19)[/+]chrispader commentedon Jun 7, 2023
necolas commentedon Jun 27, 2023
This is a bug in React Native too 34425
[fix] Animated support for string transforms
dan-doyon-endear commentedon Jun 28, 2023
Here is patch that works for us in interim
necolas commentedon Jun 28, 2023
That doesn't "work", it just skips over the issue
dan-doyon-endear commentedon Jun 28, 2023
Fair enough, we're not doing a lot with transforms and it enabled us to migrate to latest version.
dan-doyon-endear commentedon Jun 28, 2023
necolas commentedon Jun 28, 2023
Aashu-Dubey in the test case, you're trying to stringify an animated object:
That will never work.
What you can do is interpolate the whole string value (which will work in RN), or animate only the
rotateproperty (which will work only on web for now)Or
[fix] Animated fix transforms on null values
dan-doyon-endear commentedon Jun 28, 2023
getusha commentedon Aug 26, 2023
@necolas it is not working on
Animated.ViewIt appears to be functioning correctly with the
Viewcomponent; however, it seems that it is not supported within theAnimation.ViewGregoirevda commentedon Dec 14, 2023
Is there a way to combine 2+ animated values into a single transform string?
kevtronkrueger commentedon Jan 22, 2024
I'll second the question from @Gregoirevda
I do not understand what the intended future-friendly implementation is for 2+ animated objects on a single Animated.View.