Skip to content

Commit

Permalink
fix: use MemoryRouter instead of BrowserRouter to avoid 404 on GH Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
LowderPlay committed Oct 30, 2023
1 parent d8bf1cc commit c9fd2d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import Root from './Root.tsx'
import {createBrowserRouter, createRoutesFromElements, Route, RouterProvider} from "react-router-dom";
import {
createMemoryRouter,
createRoutesFromElements,
Route,
RouterProvider
} from "react-router-dom";
import {Telegram} from "@twa-dev/types";
import Settings from "./pages/Settings.tsx";
import Accounts from "./pages/Accounts.tsx";
Expand All @@ -26,7 +31,7 @@ declare global {
}
}

const router = createBrowserRouter(
const router = createMemoryRouter(
createRoutesFromElements(
<Route path="/" element={<Root />}>
<Route index={true} element={<Accounts />} />
Expand Down

0 comments on commit c9fd2d1

Please sign in to comment.