We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b07b7d commit eb167b1Copy full SHA for eb167b1
src/components/app.tsx
@@ -13,10 +13,17 @@ import Header from './header';
13
import Footer from './footer';
14
15
const App: FunctionalComponent = () => {
16
+ function removeTrailingSlash({ url }: { url: string }) {
17
+ if (!window) return;
18
+ if (url.slice(-1) === '/') {
19
+ window.history.replaceState(null, '', url.slice(0, -1));
20
+ }
21
+ };
22
+
23
return (
24
<div id="preact_root">
25
<Header />
- <Router>
26
+ <Router onChange={removeTrailingSlash}>
27
<Home path="/" />
28
<AboutUs path="/about-us" />
29
<Canteen path="/canteen" />
0 commit comments