"use strict";

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

function assignRef(ref, value) {
  if (ref == null) return;

  if (typeof ref === 'function') {
    ref(value);
  } else {
    try {
      /* eslint-disable */
      ref.current = value;
    } catch (error) {
      throw new Error("Cannot assign value \"".concat(value, "\" to ref \"").concat(ref, "\""));
    }
  }
}
//# sourceMappingURL=assignRef.js.map