Skip to content

Commit b41c5fc

Browse files
committed
deploy error
1 parent 805c02a commit b41c5fc

2 files changed

Lines changed: 13 additions & 22 deletions

File tree

src/App.jsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
import "./index.css";
22
import {
3-
createBrowserRouter,
4-
RouterProvider,
3+
Routes,
4+
Route
55
} from "react-router-dom";
66
import Home from "./pages/Home";
77
import Doc from "./pages/Doc";
8-
const router = createBrowserRouter(
9-
[
10-
{
11-
path: "/",
12-
element: <Home />,
13-
},
14-
{
15-
path: '/doc',
16-
element: <Doc />
17-
}
18-
]
19-
);
8+
209
function App() {
2110
return (
22-
<RouterProvider router={router} />
11+
<Routes>
12+
<Route path="/" element={<Home />} />
13+
<Route path="doc" element={<Doc />} />
14+
</Routes>
2315
);
2416
}
2517

src/main.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
33
import App from "./App";
4-
5-
6-
/* Creating a router object that is used to render the correct component based on the url. */
7-
4+
import { BrowserRouter } from "react-router-dom";
85

96
ReactDOM.createRoot(document.getElementById("root")).render(
10-
<React.StrictMode>
11-
<App />
12-
</React.StrictMode>
7+
<BrowserRouter>
8+
<React.StrictMode>
9+
<App />
10+
</React.StrictMode>
11+
</BrowserRouter>
1312
);

0 commit comments

Comments
 (0)