Ariakit
/

useMenuContext

Returns the menu store from the nearest menu container.

Code examples

function Menu() {
const store = useMenuContext();
if (!store) {
throw new Error("Menu must be wrapped in MenuProvider");
}
// 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.