UNPKG

@atlaskit/popup

Version:

A popup displays brief content in an overlay.

20 lines (18 loc) • 812 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TriggerRefObjectContext = void 0; var _react = require("react"); /* eslint-disable @repo/internal/react/require-jsdoc */ /** * Provides the trigger element as a stable `MutableRefObject<HTMLElement | null>` * for the top-layer path. Unlike `TriggerRefContext` (which provides * `HTMLElement | null` as React state and causes a re-render when the trigger * mounts), this context provides a ref object whose identity is stable across * renders — allowing `useAnchoredPopover` to receive a stable anchor ref without * needing to create a new ref wrapper on every `triggerRef` state change. */ var TriggerRefObjectContext = exports.TriggerRefObjectContext = /*#__PURE__*/(0, _react.createContext)({ current: null });