/* eslint-disable global-require */
import React, { useEffect, useState } from 'react';

var VRArenaSSR = function VRArenaSSR(_ref) {
  var children = _ref.children;

  var _useState = useState(false),
      rendered = _useState[0],
      setRendered = _useState[1];

  useEffect(function () {
    setRendered(true);

    if (typeof window !== 'undefined') {
      require('aframe');
    }
  }, [setRendered]);

  if (!rendered) {
    return /*#__PURE__*/React.createElement("h1", null, "loading");
  }

  return children;
};

export default VRArenaSSR;