cc-ai / floods-frontend

Frontend user-interface for the Climate Change AI Floods project
https://mila.quebec/en/ai-society/visualizing-climate-change/
2 stars 3 forks source link

Use router #16

Open vict0rsch opened 5 years ago

vict0rsch commented 5 years ago

We need to have a history in the navigation, maybe reactrouterv4?

notoraptor commented 5 years ago

Hi @vict0rsch !

We initially used react-router on ClimatePixWeb, but we ultimately dropped it because it is not well exported in production, as it creates links that cannot be directly reached. Cf. original issue here: https://github.com/cc-ai/ClimatePixWeb/issues/5

For example, router may allow us to have a link like climatechangeai.org/contact, but this link will work only if reached from home page. If anyone enters this link into a browser address bar and tries to load it, one won't find anything except a 404 error page.

So, I think we should not use react router.

If we really need to handle page links, then I can search if there is a way to handle that with React (though it won't be with Router, anyway, I think), but it may take some time for me to do that.

vict0rsch commented 5 years ago

react-router can absolutely handle this, I've used if myself, it works as expected. We can have a look at it together if you want

notoraptor commented 5 years ago

Ah, ok ! Yes, if you use it, can you show me how it works ?

vict0rsch commented 5 years ago

Yeah when can we meet for 30 min?