Pulling in and configuring react-router-dom

This commit is contained in:
Imbus 2024-03-06 10:09:59 +01:00
parent 4878ce1c39
commit 56693350be
3 changed files with 113 additions and 3 deletions

View file

@ -2,11 +2,19 @@ import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
const router = createBrowserRouter([
{
path: "/",
element: <App />,
},
]);
const root = document.getElementById("root") ?? document.createElement("div");
ReactDOM.createRoot(root).render(
<React.StrictMode>
<App />
<RouterProvider router={router} />
</React.StrictMode>,
);