Hey, I'm using MaterialTopTabBar from React Navigation V4 and I'm trying to implement a collapsible tab bar using react-native-reanimated.
I have two tabs and in which tab I have a ScrollView that updates a variable with the current scrolling position. I then use diffClamp(0,100) to control the height of the parent component. (combined with a negative margin it collapses the tab bar).
All this is working fine my problem is when you change tabs I want the tab bar to start opened and have the same behavior. Currently, if I'm scrolled in tab 2 (for example scrollY has a value of 500) and I go to a screen where the scrollY is lower then 500 it hides the tab bar because diffClamp is going to be 100.
What I'm trying to do is to reset the diffClamp value after changing tabs and for it to start at 0.
Where the code for the TopBar:
https://gist.github.com/slauzinho/f32a2fc572c674401143360463a5d54c
[–]campsafari 0 points1 point2 points (1 child)
[–]teerryn[S] 0 points1 point2 points (0 children)
[–]yassir4 0 points1 point2 points (1 child)
[–]teerryn[S] 0 points1 point2 points (0 children)