useContextMenu
useContextMenu():
object
Defined in: react/components/overlay/context-menu.tsx:106
State helper for ContextMenu: tracks open/position and exposes
openAt(x, y) / close. Spread props onto <ContextMenu>:
const menu = useContextMenu();<ContextMenu {...menu.props} items={items} onSelect={run} />Returns
Section titled “Returns”close: () =>
void
Close the menu.
Returns
Section titled “Returns”void
open:
boolean
openAt
Section titled “openAt”openAt: (
x,y) =>void
Open the menu with its top-left at screen cell (x, y).
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”void
props:
object
Props to spread onto <ContextMenu> (open, x, y, onClose).
props.onClose
Section titled “props.onClose”onClose: () =>
void
Returns
Section titled “Returns”void
props.open
Section titled “props.open”open:
boolean
props.x
Section titled “props.x”x:
number
props.y
Section titled “props.y”y:
number