react-native-reanimated-bottom-sheet
react-native-reanimated-bottom-sheet copied to clipboard
Default behavior is open
I use expo with react navigation and react screens. Bottomsheet is open when component mounts. When i wrap Bottomsheet inside View i cant open it. I tried many combinations but no luck. Anyone had same issue ?
Had the same issue I passed the prop initialSnap with value 1 and it worked. The docs say that the default value for this prop is 0, but it doesn't work for me.
Any updates on how you solved it? I'm having a similar experience (I'm also using Expo).
Not any chance it still persists
Hey guys,
if you´re using the example, the definition of the snapPoints is 450, 300 and 0.
It will open per default on snapPoint index 0 - so it´s 450.
Just set initialSnap={2}
initialSnap points to an index in the snapPoints-Array.
The snapTo() function will open the sheet at the given index of snapPoints.
In my case
onPress={() => sheetRef.current.snapTo(0)}
<BottomSheet
ref={sheetRef}
initialSnap={0}
snapPoints={[600, 0]}
borderRadius={10}
renderContent={renderContent}
/>
Had the same issue I passed the prop
initialSnapwith value 1 and it worked. The docs say that the default value for this prop is 0, but it doesn't work for me.
Initial Snap to 1 will fix the issue
initialSnap is not a valid Prop.
<BottomSheet
ref={ref}
index={-1}
snapPoints={snapPoints}
onChange={handleSheetChanges}>
</BottomSheet>
set index to -1 to hide bottomsheet in default mode
<BottomSheet ref={ref} index={-1} snapPoints={snapPoints} onChange={handleSheetChanges}> </BottomSheet>set index to -1 to hide bottomsheet in default mode
Works like charm !!!