fix: PaginationItem onPress (both Pagination.Basic and Pagination.Custom) #677
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.
Overview of the bug
As per #676, v4.0.0-canary.13 accidentally introduced a bug that caused the click events on
Pagination.Basicto no longer work.This appears to have been accidentally introduced in #655
Thanks to @qwertychouskie for reporting here:
onClickfunction of<Pagination.Basic>doesn't work #676Why
From the TouchableWithoutFeedback docs:
What: the fix
Pagination.Custom, standardize by importingTouchableWithoutFeedbackfromreact-native(like we already do forPagination.Basic)Pagination.BasicandPagination.Custom, lower the<TouchableWithoutFeedback>wrapper to inside ofPaginationItemso that it is immediately around the target<View>(or<Animated.View>) insteadWhy
When using
TouchableWithoutFeedback, it's important to keep<TouchableWithoutFeedback>immediately around the child<View>component.Suggestion for reviewer
As a bulk of the changeset is just whitespace changes, I suggest reviewing this PR with whitespace hidden -