mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
router and enable back button
This commit is contained in:
1 parent
41e207afad
commit
b1ef987f9d
5 files changed
+105
-40
No files matched your search
+15
-2
@@ -1,14 +1,27 @@
|
||||
import "./App.css";
|
||||
|
||||
import { createBrowserRouter } from "react-router";
|
||||
import { RouterProvider } from "react-router/dom";
|
||||
|
||||
import LoadingDialog from "./components/LoadingDialog";
|
||||
import { Provider } from "./components/ui/provider";
|
||||
import SearchPage from "./pages/SearchPage";
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
lazy: async () => {
|
||||
return {
|
||||
Component: (await import("./pages/SearchPage")).default,
|
||||
};
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<Provider>
|
||||
<>
|
||||
<SearchPage />
|
||||
<RouterProvider router={router} />
|
||||
<LoadingDialog />
|
||||
</>
|
||||
</Provider>
|
||||
|
||||
Reference in new issue
Block a user