From 0783248f5523007deb3227559d3ce1350ca9a496 Mon Sep 17 00:00:00 2001 From: hhpr98 <39483775+hhpr98@users.noreply.github.com> Date: Sun, 29 Oct 2023 19:59:14 +0700 Subject: [PATCH] hotfix: Switch to hashrouter since github page does not actually work with brower router if you refresh page (F5), it will show as NOT FOUND page --- src/App.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index b65e53f..b909f38 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,9 @@ import React from 'react'; import { Routes, Route, Navigate } from "react-router"; -import { BrowserRouter as Router } from "react-router-dom"; +// https://stackoverflow.com/questions/71984401/react-router-not-working-with-github-pages +// Switch to the HashRouter since GitHub pages doesn't support the tech used by the BrowserRouter. +import { HashRouter as Router } from "react-router-dom"; import MainPage from './components/MainPage/MainPage'; import PlaceDetails from './components/PlaceDetails/PlaceDetails';