"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useForkRef = useForkRef;

var _react = require("react");

var _setRef = require("../utils/setRef");

function useForkRef(refA, refB) {
  return (0, _react.useMemo)(function () {
    if (refA == null && refB == null) {
      return null;
    }

    return function (refValue) {
      (0, _setRef.setRef)(refA, refValue);
      (0, _setRef.setRef)(refB, refValue);
    };
  }, [refA, refB]);
}
//# sourceMappingURL=useForkRef.js.map