"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = useUniqueId;

var _react = require("react");

var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));

/**
 * Used for generating unique ID for elements
 */
function useUniqueId(prefix) {
  var idRef = (0, _react.useRef)();

  if (!idRef.current) {
    idRef.current = (0, _uniqueId.default)(prefix);
  }

  return idRef.current;
}