-
Notifications
You must be signed in to change notification settings - Fork 734
Refactor TabController to use Reanimated v2 API #1325
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
Conversation
const sharedLabelStyle = useSharedValue(JSON.parse(JSON.stringify(labelStyle))); | ||
const sharedSelectedLabelStyle = useSharedValue(JSON.parse(JSON.stringify(selectedLabelStyle))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this can be solved using only:
const sharedLabelStyle = useSharedValue(labelStyle);
const sharedSelectedLabelStyle = useSharedValue(selectedLabelStyle);
and in animatedLabelStyle
returning:
return (isActive ? sharedSelectedLabelStyle.value : sharedLabelStyle.value) || {};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue this solves wasn't exposed cause some code is commented out in the example screen
I pushed a code the expose the bug -> ff8c461
Description
<Code/>
blocks, now we're using shared values and animated styles.Changelog
Reimplement
TabController
component with reanimated v2 API (currently exported as TabController2)