app
app copied to clipboard
Blank page on invalid route
Right now, the web page only displays blank page if the route is invalid, e.g. /notabout
This is happening because we only have redirects for the / path.
https://github.com/WorldHealthOrganization/app/blob/3927e6d887d21dfef75aa787b566db73c16d92ea/client/ionic/src/App.tsx#L52
Solution: We could add a catch-all route to redirect to existing page or serve a 404 page. e.g.
<Switch>
<Route path="/about" component={About} exact={true} />
<Route path="/menu" component={Menu} exact={true} />
<Route path="*">
{/* Redirect or 404 here. */}
</Route>
</Switc>
Solution:
<Route component={ } exact={true} />
We can redirect to existing page by specifying the component.