Skip to content
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