Open mhb-yt opened 2 years ago
The same question for me as well
There is no other way except using the Ref.
const panelReference = React.createRef();
When pass it to the SlidingUpPanel:
<SlidingUpPanel
ref={panelReference}
...
>
Now you can access various methods (code in Typescript):
panelReference.current?.hide();
panelReference.current?.show();
How can I triger open() / hide() from anywhere in my App? Ideally I would like to use Redux actions for this.
Since the prop
visible
is not available, I don't know how to control the open/close state using redux actions. The only solution I see isforwardRefs
, but it makes the code quite complicated.Any advice on that?