aboutsummaryrefslogtreecommitdiff
path: root/bench/hot-module-reloading/css-stress-test/src/index.tsx
blob: 7ca290f48a75280d03c99240908712af61e54df7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Main } from "./main";
import classNames from "classnames";
import ReactDOM from "react-dom";

const Base = ({}) => {
  const name = typeof location !== "undefined" ? decodeURIComponent(location.search.substring(1)) : null;
  return <Main productName={name} />;
};

function startReact() {
  ReactDOM.hydrate(<Base />, document.querySelector("#reactroot"));
}

if (typeof window !== "undefined") {
  globalThis.addEventListener("DOMContentLoaded", () => {
    startReact();
  });

  startReact();
}

export { Base };