[v4] | [v2] Demo in documentation doesn't work: 'snapPoints' was provided with no points
Bug
The demo on https://ui.gorhom.dev/components/bottom-sheet/usage does not work. It seems to be missing some parameters:
Invariant Violation: 'snapPoints' was provided with no points! please provide at least one snap point.
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 4.6.3 |
| react-native | 0.74.1 |
| react-native-reanimated | 3.10.1 |
| react-native-gesture-handler | 2.16.2 |
Steps To Reproduce
- Installed package
- Followed the instructions on https://ui.gorhom.dev/components/bottom-sheet/usage
Describe what you expected to happen:
- See a page with bottom sheet
Reproducible sample code
Same for me
Guys, just add the snapPoints. Don't be stupid, it's easy
<BottomSheet
ref={bottomRef}
snapPoints={['30%', '50%']}
enablePanDownToClose
onClose={onClose}
>
No need to be rude. There's just so many libraries around that aren't maintained or not working anymore. If the demo doesn't work, I don't bother to dive any further in the documentation.
Just was reporting the issue in the example... Genius!
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
horrible
Guys, just add the snapPoints. Don't be stupid, it's easy
your docs is fakin stupid and you also
Just so you know. You can ask ChatGPT to write a Bottom Sheet Select and it will produce working code. Without any third party libraries, so it won't cost you hours to patch after the next RN update. Appreciate the authors efforts but instead of adding the line they rather argue how stupid everyone is while leaving a broken demo on the site. This is what I hate so much about the RN/Expo ecosystem, sorry to say guys.
I didn't understand either, just put snapPoints as mandatory (Typescript).
the issue still exist. getting error after adding the snapPoint .
I was importing BottomSheetModalProvider like below.
import BottomSheetModalProvider from '@gorhom/bottom-sheet';
I updated it to this and error went away.
import {BottomSheetModalProvider} from '@gorhom/bottom-sheet';
the issue still exist. getting error after adding the snapPoint .
answering to my own question. issue got resolved after wrapping th app <GestureHandlerRootView/>.
<GestureHandlerRootView style={{ flex: 1 }}>
<App/>
</GestureHandlerRootView>