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
Since upgrading to Reanimated 2.3, I have noticed many race conditions on Web. For example, if you re-render an item's style prop with different values, and then update useAnimatedStyle, the style prop won't be respected. Also, if you do a timing animation with duration 0 (or something small), you will see flickers.
I can (and plan on) opening issues for all of these, but I think the real problem is the implementation's reliance on setNativeProps. Even though we can probably find fixes for the above issues, I think there will always be race conditions with setNativeProps.
setNativeProps from react-native-web is very imperfect. While Reanimated has leveraged this API, I have found that it is very buggy, whether inside of Reanimated or not. I would like to investigate moving off of setNativeProps, and instead applying a web-specific approach of editing the DOM node's styles.
component.current.style[prop]=value
While I'm not very familiar with how Reanimated's Web implementation works, I'd like to take a look, if there is willingness to accept a PR if it works. I could start by opening a draft PR, and see if this makes sense. Maybe we could look to framer-motion or react-spring's animation implementations, since they're very stable on Web.
It's also worth noting that setNativeProps will be deprecated, so it's better to look for a future-proof solution either way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Since upgrading to Reanimated 2.3, I have noticed many race conditions on Web. For example, if you re-render an item's
style
prop with different values, and then updateuseAnimatedStyle
, thestyle
prop won't be respected. Also, if you do a timing animation with duration 0 (or something small), you will see flickers.I can (and plan on) opening issues for all of these, but I think the real problem is the implementation's reliance on
setNativeProps
. Even though we can probably find fixes for the above issues, I think there will always be race conditions withsetNativeProps
.setNativeProps
from react-native-web is very imperfect. While Reanimated has leveraged this API, I have found that it is very buggy, whether inside of Reanimated or not. I would like to investigate moving off ofsetNativeProps
, and instead applying a web-specific approach of editing the DOM node's styles.While I'm not very familiar with how Reanimated's Web implementation works, I'd like to take a look, if there is willingness to accept a PR if it works. I could start by opening a draft PR, and see if this makes sense. Maybe we could look to framer-motion or react-spring's animation implementations, since they're very stable on Web.
It's also worth noting that
setNativeProps
will be deprecated, so it's better to look for a future-proof solution either way.Beta Was this translation helpful? Give feedback.
All reactions