benevbright/react-navigation-collapsible

Possible to use collapsible subheader with collapsible header?

Closed this issue · 1 comments

Is it possible to use both the animated subheader and the header at the same time? Or is there an approach you would recommend to get the desired effect?

@cmaycumber

Yes, Just add translateY={translateY} from useCollapsibleHeader to CollapsibleSubHeaderAnimator

like this ...

const {onScroll, translateY, scrollIndicatorInsetTop} = useCollapsibleHeader({
    navigationOptions: {
      headerStyle: {
        backgroundColor: 'transparent',
      },
    },
  });

return(
<>
  <CollapsibleSubHeaderAnimator translateY={translateY}> 
          {...child}
  </CollapsibleSubHeaderAnimator>
</>
)