Added wouter for hash-based routing

This commit is contained in:
Kenan Alić
2025-09-23 18:38:43 +02:00
parent 18107b71ef
commit 23752a9c6c
6 changed files with 58 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
const NotFound = () => <>NotFound</>;
export default NotFound;

View File

@@ -1,2 +0,0 @@
const Root = () => <>Root</>;
export default Root;

View File

@@ -0,0 +1,17 @@
/* Wouter */
import { Router, Switch, Route } from "wouter";
import { useHashLocation } from "wouter/use-hash-location";
/* Routes */
import NotFound from "./NotFound";
const RootRouter = () => (
<Router hook={useHashLocation}>
<Switch>
{/* Fallback (eg. 'Not Found / 404') */}
<Route component={NotFound} />
</Switch>
</Router>
);
export default RootRouter;