MCPcopy Create free account
hub / github.com/dailydotdev/apps / toggle

Function toggle

packages/shared/src/components/dropdown/DropdownMenu.tsx:167–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165 // A controlled root's open prop wins over the local state, as it does
166 // in Radix below.
167 const toggle = () => {
168 const next = !(props.open ?? open);
169 props.onOpenChange?.(next);
170 setOpen(next);
171 };
172
173 return (
174 <DropdownMenuRootContext.Provider value={{ close, toggle, isPhone }}>

Callers 1

DropdownMenu.tsxFile · 0.70

Calls 1

setOpenFunction · 0.85

Tested by

no test coverage detected