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
Hello, I have a custom built "TabBar" component that shows/hides two tabs. Within each tab is a group of components using a mix of shared values and animated props. I'm running into two issues and wondering if there is a better way to accomplish this or I've run into some kind of bug?
I have a component that holds several shared values and the tab bar.
TabBar is simple and just renders two tabs and switches active index on click. LightFace is complicated, but works just fine without the tab switching.
ColorWheel updates the hue / saturation values passed into it in a PanGestureHandler, but its functionality does not seem to be affected by the tab switch.
When switching tabs, the color props passed to the animated gradient get dropped and return unexpected results. Once a gesture/animation runs, they restore to the proper values. Additionally, the update of the tab bar component is significantly slower with the inclusion of all of the components using animated values.
I've occasionally got this to work as expected which makes me think there is a race condition happening between the JS render and the UI thread update?
Video of behavior is below.
Any ideas? Is there a better way of achieving this? Is the issue in the LinearGradient component instead? Any help much appreciated 🙏
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have a custom built "TabBar" component that shows/hides two tabs. Within each tab is a group of components using a mix of shared values and animated props. I'm running into two issues and wondering if there is a better way to accomplish this or I've run into some kind of bug?
I have a component that holds several shared values and the tab bar.
TabBar
is simple and just renders two tabs and switches active index on click.LightFace
is complicated, but works just fine without the tab switching.The
AnimatedLinearGradient
uses this 3rd party library: https://github.com/react-native-linear-gradientColorWheel
updates the hue / saturation values passed into it in aPanGestureHandler
, but its functionality does not seem to be affected by the tab switch.When switching tabs, the color props passed to the animated gradient get dropped and return unexpected results. Once a gesture/animation runs, they restore to the proper values. Additionally, the update of the tab bar component is significantly slower with the inclusion of all of the components using animated values.
I've occasionally got this to work as expected which makes me think there is a race condition happening between the JS render and the UI thread update?
Video of behavior is below.
Any ideas? Is there a better way of achieving this? Is the issue in the
LinearGradient
component instead? Any help much appreciated 🙏Screen.Recording.2021-12-26.at.7.37.23.PM.mov
Beta Was this translation helpful? Give feedback.
All reactions