"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = useId;
var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));
var _react = require("react");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
 * Generates a unique id.
 *
 * TODO: Once we're on React 18, we can use the `useId` hook instead of rolling
 * our own with `useRef` and lodash.
 */
function useId(prefix, providedId) {
  return (0, _react.useRef)(providedId ?? (0, _uniqueId.default)(prefix)).current;
}