import { useMemo } from "react";
var useForkRef = function (refs) {
    return useMemo(function () {
        if (refs.length < 1) {
            return null;
        }
        return function (refValue) {
            refs.forEach(function (ref) {
                if (typeof ref === "function") {
                    ref(refValue);
                }
                else if (ref) {
                    ref.current = refValue;
                }
            });
        };
    }, [refs]);
};
export default useForkRef;
