ScalablyTyped / SlinkyDemos

MIT License
29 stars 8 forks source link

material-ui: Use the react-router-dom switch #35

Closed AlexITC closed 3 years ago

AlexITC commented 3 years ago

This prevents that several components get rendered at the same time, the switch will render the first matching component.

oyvindberg commented 3 years ago

Thanks! I'll test it locally within a few days, I'm curious if it solves all reloading issues both locally and when published. If you feel like it it would be nice to do the same change for the actual react router demo

AlexITC commented 3 years ago

There are other minor changes I was planning to submit but I forget, like the webpack config, and, adding a handler for unknown routes, which should solve the local issues. On the issues from the published app, you need that the server returns the index.html instead of a 404.

It can certainly be worth to add this to the react-router-demo

AlexITC commented 3 years ago

I have pushed the changes to fix the webpack config, and a global route handler to redirect to "/", that should fix the local reloading issues.

AlexITC commented 3 years ago

Merged manually.