Home / Function/ ContextMenuContainer() — react Function Reference

ContextMenuContainer() — react Function Reference

Architecture documentation for the ContextMenuContainer() function in ContextMenuContainer.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1822008f_3c73_f2f9_670f_7a98ee5827d0["ContextMenuContainer()"]
  e4529f9b_7766_7a2e_07e3_67f2ba0197cf["ContextMenuContainer.js"]
  1822008f_3c73_f2f9_670f_7a98ee5827d0 -->|defined in| e4529f9b_7766_7a2e_07e3_67f2ba0197cf
  style 1822008f_3c73_f2f9_670f_7a98ee5827d0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenuContainer.js lines 27–59

export default function ContextMenuContainer({
  anchorElementRef,
  items,
  closedMenuStub = null,
  ref,
}: Props): React.Node {
  const {shouldShow, position, hide} = useContextMenu(anchorElementRef);

  useImperativeHandle(
    ref,
    () => ({
      isShown() {
        return shouldShow;
      },
      hide,
    }),
    [shouldShow, hide],
  );

  if (!shouldShow) {
    return closedMenuStub;
  }

  return (
    <ContextMenu
      anchorElementRef={anchorElementRef}
      position={position}
      hide={hide}
      items={items}
      ref={ref}
    />
  );
}

Domain

Subdomains

Frequently Asked Questions

What does ContextMenuContainer() do?
ContextMenuContainer() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenuContainer.js.
Where is ContextMenuContainer() defined?
ContextMenuContainer() is defined in packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenuContainer.js at line 27.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free