I'm now extremely happy with my new router of choice router5 (not to be confused with React Router 5) https://router5.js.org.
I'm now extremely happy with my new router of choice router5 (not to be confused with React Router 5) https://router5.js.org.
I wrote 2 articles about it in case it can help someone:
- https://www.vincentprouillet.com/blog/testing-a-different-sp...
- https://www.vincentprouillet.com/blog/testing-a-different-sp...
It probably changed a bit since those articles but I was happy with it. A very simple codebase using that can be seen on https://github.com/Keats/hn-react
I've had a look at react-router multiple times over the years, and the best thing going for them seems to have been that they managed to squat that generic name early on. From the docs and GitHub, it's always been abundantly clear that the "current version sucks, mistakes were made, next version will totally fix everything" again and again.
1. Having to write middleware for many things is quite hard for junior devs, as it requires deep understanding of how router works. (We have middleware for dependency injection, MobX per-page store, data fetching, auth check)
2. Due to the tree-based router design, some routes are impossible. See https://github.com/troch/route-node/issues/17 https://github.com/troch/route-node/issues/18
I still haven't found router of my choice yet. Maybe router5 without route-note could work for me, but I still wouldn't recommend it to any team.
Not only is router5's API simple, well-documented and easily programmable, the router5 folks have been receptive to feedback and pull requests. They also keep fairly well up-to-date compared to react-router (router5 supports React hooks, react-router doesn't yet).
I'm content with the direction and design of router5 and encourage others to check it out.
And used router5 for that.
Didn't even need that many hacks: https://gist.github.com/dmitriid/675ceff4bd07ec6cdf06a560d72...
How well does router5 work with redux? I see they have an official package for it, so it's looking good, but maybe you have first hand experience.