"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useAutoFocus = useAutoFocus;
const react_1 = require("react");
function useAutoFocus(ref, dependencies = [], timeout = 0) {
    (0, react_1.useEffect)(() => {
        const timeoutId = setTimeout(() => {
            ref.current?.focus();
        }, timeout);
        return () => {
            clearTimeout(timeoutId);
        };
        // https://github.com/facebook/react/issues/23392#issuecomment-1055610198
        // eslint-disable-next-line react-hooks/exhaustive-deps
    }, dependencies);
}
//# sourceMappingURL=useAutoFocus.js.map
