import React from "react";
import ReactDOM from "react-dom/client";
import { createBrowserHistory } from "history";
import { App } from "./App";

console.log("Starting app");

const renderResistants = () => {
  console.log("Rendering app");
  ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
    <React.StrictMode>
      <App />
    </React.StrictMode>
  );
};

const browserHistory = createBrowserHistory();
browserHistory.listen(() => {
  console.log("re-rendering");
  renderResistants();
});

renderResistants();

console.log("done");
