import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';
import { useContext, useState } from 'react';
import { SSRContext } from '../components/SSRProvider/SSRProvider.js';

var noSSRId = 0;

/**
 * @deprecated
 * @see используете вместо этого safeUseId
 */
function useUniqId() {
  var context = useContext(SSRContext);
  var _useState = useState(function () {
      if (context.uniqId !== null) {
        return "plasma-uniq-id-ssr-".concat(++context.uniqId);
      }
      return "plasma-uniq-id-".concat(++noSSRId);
    }),
    _useState2 = _slicedToArray(_useState, 1),
    id = _useState2[0];
  return id;
}

export { useUniqId };
