# 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

```ts
import { useFocusTarget } from "@mapcairn/map";
 
function useFocusTarget(name: FocusName): (element: HTMLElement | null) => void;
```

## Parameters

- `name` (`FocusName`)

## Returns

`(element: HTMLElement | null) => void`

## See also

- [`FocusName`](https://docs.mapcairn.com/api/map/FocusName.md)

Source: [packages/map/src/chrome/focusRegistry.tsx:99](https://github.com/MapCairn/mapcairn/blob/main/packages/map/src/chrome/focusRegistry.tsx#L99)
