DEV Community

Discussion on: react-native-bottomsheet-reanimated

Collapse
parazitenew profile image
parazitenew • Edited on

Hi, the ref method is not working.

this.sheetRef = React.createRef(); (inside props constructor)
ref={this.sheetRef} as prop of the BottomSheet component.

Then onPress button I call a function that do this:
this.sheetRef.current.snapTo('50%');

returning error: undefined is not an object (evaluating 'snapPoint.tension')

Thread Thread
saffellikhan profile image
Saif Ali Khan

this.sheetRef.current.snapTo('50%'); //here you was wrong. please use array index number instead of '50%'.