Returns the disclosure store from the nearest disclosure container.

Code examples

function Disclosure() {
const store = useDisclosureContext();
if (!store) {
throw new Error("Disclosure must be wrapped in DisclosureProvider");
// Use the store...

Stay tuned

Join 1,000+ subscribers and receive monthly tips & updates on new Ariakit content.

No spam. Unsubscribe anytime. Read latest issue