Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: use ScrollView as parent (Android) #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ function CityPicker() {
## Memoization

The individual items in the picker (`<WheelPickerItem />`) are [strictly memoized](https://github.com/erksch/react-native-wheely/blob/master/src/WheelPickerItem.tsx#L109-L114), meaning that they will not rerender after the initial render. Rerendering the picker items uncontrollably would lead to bad performance with large number of options. Item styles, animation functions and other parameters of items therefore must be static and changes to them after the initial render will have no effect.


## ScrollView
If you need to use this component inside another scrollView, we suggest to use the scrollView imported from `react-native-gesture-handler`, and also you must turn on the `nestedScrollEnabled` property of your scrollView (for Android devices).
1 change: 1 addition & 0 deletions src/WheelPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const WheelPicker: React.FC<Props> = ({
<Animated.FlatList<string | null>
{...flatListProps}
ref={flatListRef}
nestedScrollEnabled
style={styles.scrollView}
showsVerticalScrollIndicator={false}
onScroll={Animated.event(
Expand Down