Closed Khuongnb closed 3 years ago
Hi @Khuongnb, here is the definition of the pager props. It does not include the onScroll
.
But no worries, you don't need it to create your tab bar. The props passed to the tab bar component probably have all you need. Here is the definition:
export type TabBarProps<T extends TabName = TabName> = {
indexDecimal: Animated.SharedValue<number>
focusedTab: Animated.SharedValue<T>
tabNames: T[]
index: Animated.SharedValue<number>
containerRef: React.RefObject<ContainerRef>
onTabPress: (name: T) => void
tabProps: TabsWithProps<T>
}
For example, to interpolate the indicator you can use the indexDecimal
prop. Or for example if don't want it to "follow" the swiping, just jump from one place to another, you can use the index
.
Take a look at the default tab bar for pointers. If you need more help building it, post it here and we continue the conversation :)
I will close for now.
Current behavior
Expected behaviour
HeaderComponent should be collapsible when scrolling Tab B
Code sample
What have you tried
In case you want to know what am I doing, I'm writing a custom TabBarComponent instead of using MaterialTabBar so I need to use pagerProps.onScroll to create animation for the TabBar bottom Indicator