Open History to see the last commit
1import { useState } from "react";
2
3export function useComposerMenuState(hidden = false) {
4 const [open, setOpen] = useState(false);
5 // Closing via the open prop does not notify Base UI listeners; reset stored state too.
6 if (hidden && open) {
7 setOpen(false);
8 }
9 return [open && !hidden, setOpen] as const;
10}