matinzd/rn-bottom-sheet

How to use method toggleDrawerState() or getDrawerState()

Closed this issue · 2 comments

Can i get the example code how to use method toggleDrawerState() or getDrawerState() in class componnent or react hooks, Thank you

Joeao commented

Pretty sure you need to bind the ref to a variable on render, then call methods on the ref.
I'm on my phone so can't give a well formatted example, and I've not tested.
But I think you do something like:

Let bottomSheetComponent;

render (
<BottomSheet
    Ref={(comp) => bottomSheetComponent = comp}
    />
)
...
const toggleSheet() => {
    bottomSheetComponent.toggleDrawerState()
}

oh i see, thank you for your response