import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import { useState, useMemo, useDebugValue } from "react";
export default (function (clobber, defaultIfNotClobbered) {
  var isClobbered = useMemo(function () {
    return clobber !== undefined;
  }, //eslint-disable-next-line
  []);
  useDebugValue(isClobbered ? "Clobbered" : "Not Clobbered");

  var _useState = useState(defaultIfNotClobbered),
      _useState2 = _slicedToArray(_useState, 2),
      notClobberedValue = _useState2[0],
      setNotClobberedValue = _useState2[1];

  if (isClobbered) {
    return [clobber, undefined];
  } else {
    return [notClobberedValue, setNotClobberedValue];
  }
});