Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 792 Bytes

File metadata and controls

19 lines (11 loc) · 792 Bytes

Home > @asl-19/react-dom-utils > useFocusElementAfterRender

useFocusElementAfterRender() function

Focus a provided element after the current render.

This is necessary to focus an element that will only become focusable after the current render is complete (e.g. if the element comes into view as a result of a setState an event callback).

Signature:

useFocusElementAfterRender: () => import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>

Returns:

import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>