fix: allow to override gesture handler props in Swipable #856
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I was playing a bit with the Swipeable component. I tried to put it inside
react-native-tab-view
.I had a common case, where there is a list of swipable elements on one of the tabs. I turned out I cannot swipe tab view because of the underlying
<PanGestureHandler/>
.In my case overriding
minDeltaX
oractiveOffsetX
on<PanGestureHandler/>
fixes the issue due to a specific placement of swipeable elements on the last tab on the right. I had to patch a package to be able to overrideminDeltaX
since props have been spread in first line of the file.I decided to open a PR with that fix.
It replaces legacy
minDeltaX
withactiveOffsetX
, spread props belowactiveOffsetX
and also improve TypeScript types for this component, so now it inherits props from<PanGestureHandler/>
.