Ariakit
/

useDialogContext

Returns the dialog store from the nearest dialog container.

Code examples

function Dialog() {
const store = useDialogContext();
if (!store) {
throw new Error("Dialog must be wrapped in DialogProvider");
}
// Use the store...
}

Follow updates

Join 1,000+ subscribers and receive monthly updates with the latest improvements on API Reference.

Read latest issue

No Spam. Unsubscribe at any time.