diff --git a/README.md b/README.md index da91e28f6..8a8736672 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,12 @@ npm install @gorhom/bottom-sheet > ⚠️ You need to install [react-native-reanimated](/~https://github.com/software-mansion/react-native-reanimated) & [react-native-gesture-handler](/~https://github.com/software-mansion/react-native-gesture-handler) and follow their installation instructions. - ### Version v2 ( Alpha ) [Link to version 2 branch](/~https://github.com/gorhom/react-native-bottom-sheet/tree/feature/rewrite-in-reanimated-v2) this version is written with `Reanimated v2`, although this version is still in alpha phase, yet it provides all version 1 functionalities with the huge performance boost, thanks to `Reanimated v2` ❤️ - ```sh yarn add @gorhom/bottom-sheet@2.0.0-alpha.0 # or @@ -143,9 +141,15 @@ Top inset value helps to calculate percentage snap points values. usually comes > `required:` NO | `type:` number | `default:` 0 -#### `enabled` +#### `enableContentPanningGesture` + +Enable content panning gesture interaction. + +> `required:` NO | `type:` boolean | `default:` true + +#### `enableHandlePanningGesture` -To enable or disable user interaction with the sheet. +Enable handle panning gesture interaction. > `required:` NO | `type:` boolean | `default:` true diff --git a/example/src/screens/advanced/CustomHandleExample.tsx b/example/src/screens/advanced/CustomHandleExample.tsx index 8ae46cc4c..ae975ac89 100644 --- a/example/src/screens/advanced/CustomHandleExample.tsx +++ b/example/src/screens/advanced/CustomHandleExample.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useMemo, useRef, useState } from 'react'; +import React, { useCallback, useMemo, useRef } from 'react'; import { View, StyleSheet, Text } from 'react-native'; import BottomSheet from '@gorhom/bottom-sheet'; import Handle from '../../components/handle'; @@ -6,17 +6,11 @@ import Button from '../../components/button'; import ContactList from '../../components/contactList'; const CustomHandleExample = () => { - // state - const [enabled, setEnabled] = useState(true); - // hooks const bottomSheetRef = useRef(null); // variables const snapPoints = useMemo(() => [150, 300, 450], []); - const enableButtonText = useMemo(() => (enabled ? 'Disable' : 'Enable'), [ - enabled, - ]); // callbacks const handleSnapPress = useCallback(index => { @@ -31,9 +25,6 @@ const CustomHandleExample = () => { const handleClosePress = useCallback(() => { bottomSheetRef.current?.close(); }, []); - const handleEnablePress = useCallback(() => { - setEnabled(state => !state); - }, []); // renders const renderHeader = useCallback(() => { @@ -76,14 +67,8 @@ const CustomHandleExample = () => { style={styles.buttonContainer} onPress={handleClosePress} /> -