Ability to toggle visible to true or false on Disclosures #1041
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
One solution might be to use the That allows you to tie into the hook happening within the Disclosure. I've set up a very simple example that might help you out here: https://codesandbox.io/s/disclosure-state-ebl15?file=/src/index.tsx Let us know if that helps. |
Beta Was this translation helpful? Give feedback.
-
@richbachman Thank you. That helped. I was trying to avoid it due to the warning about using state hooks but it solved the problem I had. |
Beta Was this translation helpful? Give feedback.
Hi @bvsillorequez
One solution might be to use the
useDisclosureState
hook andstate
prop: https://paste.twilio.design/components/disclosure#using-state-hooksThat allows you to tie into the hook happening within the Disclosure. I've set up a very simple example that might help you out here: https://codesandbox.io/s/disclosure-state-ebl15?file=/src/index.tsx
Let us know if that helps.