"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "useForkRef", {
    enumerable: true,
    get: function() {
        return useForkRef;
    }
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
var _utils = require("../utils");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
var useForkRef = function useForkRef(refOne, refTwo) {
    return _react.default.useMemo(function() {
        if (refOne == null && refTwo === null) {
            return null;
        }
        return function(refOb) {
            (0, _utils.setRef)(refOne, refOb);
            (0, _utils.setRef)(refTwo, refOb);
        };
    }, [
        refOne,
        refTwo
    ]);
};
