mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-11 08:43:04 +00:00
12 lines
225 B
TypeScript
12 lines
225 B
TypeScript
import { useCallback } from "react";
|
|
|
|
export default function useAutoFocus() {
|
|
const inputRef = useCallback((inputElement: any) => {
|
|
if (inputElement) {
|
|
inputElement.focus();
|
|
}
|
|
}, []);
|
|
|
|
return inputRef;
|
|
}
|