/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { type FocusTrapInitialFocus } from '@lexical/a11y'; import { type RefCallback } from 'react'; export type { FocusTrapInitialFocus } from '@lexical/a11y'; /** * Returns a `RefCallback` that registers the attached DOM element as a * focus-trap container with {@link FocusTrapExtension}. The trap * activates when `isActive` is `true` and the element is mounted, and is * released when the element detaches or `isActive` becomes `false`. * * ```tsx * const trapRef = useLexicalFocusTrapRef(true, 'container'); * return