Return the focus to the element that had it before something opened, such as a modal.
This is custom React hooks, you need to follow the Basic Rules when you use it.
Close the box and the focus goes back to the button that opened it.
const useFocusReturn = (options: {
opened: boolean
shouldReturnFocus?: boolean
}) => () => void