-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: exported Pager, PagerConsumer, PagerContext, and PagerContextType #964
Conversation
Additionally exported PagerConsumer, PagerContext, and PagerContextType Added gestureHandlerRef to Pager.providerVal
Thanks! |
@satya164 Any reason this was reverted? |
It's not something we want to expose as public API because there are issues with it, like: not being able to remove a ref once you add it, |
This was the name that was already in place, I just exported it. Perhaps changing the name would be a better solution?
Sure, definitely, but the general standard is to export Consumer and Provider components for ease of use. This is still not a reason to revert completely however, you could just remove this export very easily. Reverting this pull request breaks code that needs to use a PanGestureHandler inside another container that uses GestureHandlers. Can you explain any more specific issues with this PR? |
Is this a common behaviour? Adding this functionality should be approximately three lines of code, if that. Is this a valid reason to revert this PR? |
We believe that this change breaks the OCP of the library and we're strongly motivated to not move with having these exports included in the lib. |
"I have problems with understanding your issue"
This means that adding extra gesture functionality inside a MaterialTopTabNavigator causes the left/right swiping in the TabNavigator to be broken. Please run the example I provided within a MaterialTopTabNavigator. With this PR, the code runs just fine, but without it breaks. |
Motivation
This allows child PanGestureHandlers to call addGestureHandlerRef using PagerConsumer (and PagerContext), and additionally allows them to waitFor the Pager PanGestureHandler through the addition of gestureHandlerRef to Pager.providerVal
Problems Solved
Using a PanGestureHandler inside a MaterialTopTabNavigator from react-navigation steals pan gesture input from the Pager used by TabView.
Example Usage
Inside a MaterialTopTapNavigator with
swipeEnabled = true
Test plan