react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

[v4] | [v2] Demo in documentation doesn't work: 'snapPoints' was provided with no points

Open vliegelientje opened this issue 1 year ago • 5 comments

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

  1. Installed package
  2. Followed the instructions on https://ui.gorhom.dev/components/bottom-sheet/usage

Describe what you expected to happen:

  1. See a page with bottom sheet

Reproducible sample code

vliegelientje avatar May 28 '24 08:05 vliegelientje

Same for me

ilfoxo avatar Jun 01 '24 21:06 ilfoxo

Guys, just add the snapPoints. Don't be stupid, it's easy

sebastianbila avatar Jun 03 '24 11:06 sebastianbila

<BottomSheet
     ref={bottomRef}
     snapPoints={['30%', '50%']}
     enablePanDownToClose
     onClose={onClose}
   >

sebastianbila avatar Jun 03 '24 11:06 sebastianbila

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.

vliegelientje avatar Jun 03 '24 13:06 vliegelientje

Just was reporting the issue in the example... Genius!

ilfoxo avatar Jun 03 '24 16:06 ilfoxo

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.

github-actions[bot] avatar Jul 04 '24 09:07 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jul 09 '24 09:07 github-actions[bot]

horrible

fubd avatar Jul 26 '24 08:07 fubd

Guys, just add the snapPoints. Don't be stupid, it's easy

your docs is fakin stupid and you also

HoSheiMa avatar Aug 06 '24 02:08 HoSheiMa

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.

vliegelientje avatar Aug 06 '24 06:08 vliegelientje

I didn't understand either, just put snapPoints as mandatory (Typescript).

RuyVictor avatar Aug 21 '24 20:08 RuyVictor

the issue still exist. getting error after adding the snapPoint .

SHUHAIB-T avatar Sep 18 '24 11:09 SHUHAIB-T

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';

umer-nazir02 avatar Sep 23 '24 09:09 umer-nazir02

the issue still exist. getting error after adding the snapPoint .

answering to my own question. issue got resolved after wrapping th app <GestureHandlerRootView/>.

documentation

   <GestureHandlerRootView style={{ flex: 1 }}>
          <App/>
   </GestureHandlerRootView>

SHUHAIB-T avatar Sep 23 '24 11:09 SHUHAIB-T