Skip to main content

useFocusTarget

Returns a ref callback to put on the control that opens a surface, so focus can come back to it: <IconButton ref={useFocusTarget("map-options")} />.

This is a function exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import { useFocusTarget } from "@mapcairn/map";

function useFocusTarget(name: FocusName): (element: HTMLElement | null) => void;

Parameters​

  • name (FocusName)

Returns​

(element: HTMLElement | null) => void

See also​

Source: packages/map/src/chrome/focusRegistry.tsx:99