Skip to main content

useFocusFrom

function useFocusFrom(element): object;

This hook gives the ability to set the focus on an element which is then blurred right away, thereby effectively resetting the focus order. The next focusable element that comes after this element will be focused on the next tab.

Parameters

ParameterTypeDescription
elementnull | HTMLElementelement which focus point should start from

Returns

object

focusFrom function, when called sets the focus point to the given element

NameType
focusFrom()() => void