app icon indicating copy to clipboard operation
app copied to clipboard

Blank page on invalid route

Open darcien opened this issue 6 years ago • 1 comments

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>

darcien avatar Mar 22 '20 08:03 darcien

  Solution:
            
              <Route component={ } exact={true} />

We can redirect to existing page by specifying the component.

navikalingoth avatar Mar 24 '20 22:03 navikalingoth