import React from "react";
import ReactDOM from '../react-dom/client';
import App from "./App";
import { Provider as Jotai } from "./jotai";
import SSRContextProvider from "./SSRContextProvider";

let app = <App />;
if (import.meta.hot) {
  app = <Jotai>{app}</Jotai>;
}

const container = document.getElementById("root");
if (container) {
  const root = ReactDOM.createRoot(container);
  root.render(<SSRContextProvider>{app}</SSRContextProvider>);
}
