Skip to content

Commit 459cd11

Browse files
committed
docs(ContextMenu): createContextMenu's request effect names what it synchronizes with (react-component-runtime INV3)
The effect hands requests from outside React (the element's own listeners and the controller's open() and close()) to the menu's handle once it has rendered; the menu reports onOpenChange from its own show and hide (INV2).
1 parent 5cf5d48 commit 459cd11

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/core/src/ContextMenu/createContextMenu.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ function AttachedMenu({
374374
.display.startsWith('inline') ?? false,
375375
);
376376
const handleOpenChange = onOpenChange;
377+
// Synchronizes the menu with requests from outside React: the element's
378+
// own listeners (its context request) and the controller's open() and
379+
// close() arrive as `forwarded`, and each reaches the menu's handle once
380+
// it has rendered; the menu reports `onOpenChange` from its own show and
381+
// hide.
377382
useLayoutEffect(() => {
378383
if (forwarded == null) {
379384
return;

0 commit comments

Comments
 (0)