beefe / react-native-actionsheet

An elegant ActionSheet component for React Native.
MIT License
1.35k stars 345 forks source link

how to use hook to ref ActionSheet #119

Closed MahmudHasanMenon closed 4 years ago

MahmudHasanMenon commented 4 years ago

<CustomActionSheet ref={o => ActionSheet = o} title={'Please select an option for uploading photo'} options={['Choose Photo', 'Take Photo', 'Cancel']} cancelButtonIndex={2} onPress={(index) => { }} /> to show ActionSheet showActionSheet = () => { this.ActionSheet.show() }

MahmudHasanMenon commented 4 years ago

I just solve the problem. here is some step i followed.

`const CustomActionSheet = useRef();

<ActionSheet ref={CustomActionSheet} title={'Please select an option for uploading photo'} options={['Choose Photo', 'Take Photo', 'Cancel']} cancelButtonIndex={2} onPress={(index) => { }} />

CustomActionSheet.current.show()