'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var SSRProvider = require('../components/SSRProvider/SSRProvider.js');

var noSSRId = 0;

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

exports.useUniqId = useUniqId;
