diff --git a/README.md b/README.md index 337fea6..5aad28d 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,7 @@ function CityPicker() { ## Memoization The individual items in the picker (``) 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). \ No newline at end of file diff --git a/src/WheelPicker.tsx b/src/WheelPicker.tsx index cd0f0c4..ca3154d 100644 --- a/src/WheelPicker.tsx +++ b/src/WheelPicker.tsx @@ -131,6 +131,7 @@ const WheelPicker: React.FC = ({ {...flatListProps} ref={flatListRef} + nestedScrollEnabled style={styles.scrollView} showsVerticalScrollIndicator={false} onScroll={Animated.event(