React Hookers - v6.3.0
    Preparing search index...

    Function useFocusScope

    • Creates a focus scope inside a container element and returns controls to move focus within it.

      Parameters

      • ref: RefObject<Element | null>

        A ref to a container element inside which focus state is managed.

      • props: FocusScopeProps = emptyObject

        Focus-scope props.

      Returns FocusControls

      Focus controls that allow moving focus within the container element. An object whose identity never changes between renders.

      const containerRef = useRef(null);
      const focusControls = useFocusScope(containerRef);

      <FocusControlsProvider value={focusControls}>
      <div ref={containerRef}>
      <input />
      </div>
      </FocusControlsProvider>