-
I'd like to build an experience where the Disclosure open/close state is controlled external to the Disclosure itself. Is this currently possible? If so, how? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @sebm, This part of our docs kind of alludes to it: https://paste.twilio.design/components/disclosure#using-state-hooks |
Beta Was this translation helpful? Give feedback.
-
We'll be adding the props to the state hook on the docs site in the next week too |
Beta Was this translation helpful? Give feedback.
Hi @sebm,
This part of our docs kind of alludes to it: https://paste.twilio.design/components/disclosure#using-state-hooks
It isn't super clear though, but yes you can tap into internal state of any of our components. Here's an example solution with Disclosure: https://codesandbox.io/s/controlled-disclosure-toggle-state-regp5?file=/pages/index.js