Open rmallols opened 6 years ago
Technical guidance:
Create a new NotFound
component, and return an error message (e.g. Ooops, it looks like this page doesn't exist :(
)
BONUS: As this a very basic component, it may be a good opportunity to start using functional components
for simplicity reasons
https://hackernoon.com/react-stateless-functional-components-nine-wins-you-might-have-overlooked-997b0d933dbc
Create a new /not-found
route on App.js
Please use <switch>
to ensuring no other routers are matched
https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/Switch.md
Ensure you can access the new route (http://localhost:3000/not-found
) while the old routes still work.
Then, on the routing component, redirect to /not-found
if no route is matched.
https://stackoverflow.com/questions/32128978/react-router-no-not-found-route
(Please note we're using React V4)
At the moment, we have some valid URLs available:
http://localhost:3000
http://localhost:3000/create-new-wallet
http://localhost:3000/login-to-wallet
http://localhost:3000/transfer
User sometimes type invalid URLs by mistake (e.g.
http://localhost:3000/create-new-walet
). At the moment, we're not handling these kind of typos, so users aren't getting the appropriate feedback.