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