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...
}

Stay tuned

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

No spam. Unsubscribe anytime. Read latest issue