Live data from Hacker News

React Router v5

reacttraining.com

41–50 of 90 posts

Re: React Router v5

#41
post #39

I advise everyone to move away from React Router. Maintainers who have such blatant disregard for users should not be rewarded or celebrated.

May I ask what are you making reference to? And do you happen to know a better library?

Re: React Router v5

#42
post #24
post #5

We migrated from React Router to Reach Router ( https://reach.tech/router ) and found it to be better in a few ways: * Built-in focus management. * Smaller library size. * Implicit route matching that Just Works. * More comprehensive docs with live examples. Migration was easy. Highly recommended.

We did the same thing, then migrated back to React-Router. We had issues getting relative urls and redirects to work, examples were hard to come by, and generally the experience was just poorer than React-Router.

I did the same as you, initially reach router seemed like a great alternative, but it really doesn't feel finished, updates are few and far inbetween, and there is a large backlog of open issues / PRs.

Re: React Router v5

#43
post #39

I advise everyone to move away from React Router. Maintainers who have such blatant disregard for users should not be rewarded or celebrated.

That's weird, I've had nothing but a great experience with the React Router team. Can you point to an example?

Re: React Router v5

#45

I migrated away from react-router because from v3 to v4 broke everything that made sense. Things became wildly more complicated. 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 tried router5 in our team and found that while it is more powerful,

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.

Re: React Router v5

#46
post #5

We migrated from React Router to Reach Router ( https://reach.tech/router ) and found it to be better in a few ways: * Built-in focus management. * Smaller library size. * Implicit route matching that Just Works. * More comprehensive docs with live examples. Migration was easy. Highly recommended.

So both of these routers are written by Ryan Florence? Interesting, what was the reason behind this? Freedom to experiment in one repo while keeping the other stable?

Re: React Router v5

#47

I migrated away from react-router because from v3 to v4 broke everything that made sense. Things became wildly more complicated. 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 did the same thing, although I might have migrated before v3.

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

Re: React Router v5

#48
react-router depends on the ReactTraining/history package for browser navigation support.

On 10 June 2017, an mind-bogglingly ill-conceived pull request[1] was merged, which causes invalid URLs to be pushed to the browser history, breaking the back button and page refresh in many scenarios.

Ever since, users have practically been begging the maintainer to fix the bug[2] and implementing hacky workarounds[3].

In a twist of irony, the contributor who originally introduced the bug has:

a) switched their own competing router package to a different history implementation[4]

b) argued that fixing the bug (which was introduced in a patch release) would require a major version bump, implying it would be better to let it remain broken[5].

I concede that the software is open source, and nobody is entitled to make any demands of the maintainers. Nevertheless, I pity the countless end-users who are left wondering why the most basic functionality of their web browsers is broken.

[1]: https://github.com/ReactTraining/history/pull/465

[2]: https://github.com/ReactTraining/history/issues/505

[3]: https://github.com/elastic/kibana/pull/32365

[4]: https://github.com/pshrmn/curi/commit/e850bcd9297398653a79b9...

[5]: https://github.com/ReactTraining/history/pull/656

Re: React Router v5

#49
post #18
post #13

Using react router on one of my personal projects (~ 30k loc) was probably one of my largest regrets. At every turn it seemed designed to do the thing I wouldn’t expect, or have arbitrary restrictions that made my life tougher. Some examples: * there's no relative routes https://github.com/ReactTraining/react-router/issues/2172 * there's no way to refresh the page https://github.com/ReactTraining/react-router/issues/…

Yup. I only use react-router when I have to (work). My other projects I always roll my own. A typical html5 push router can be really small. I don’t reinvent the wheel normally but routing is hugely overcomplicated in the react ecosystem.

I feel like part of the problem with react libraries is that they implement their code "the react way" which basically means forcing it into your tree hierarchy. Dealing with dozens of higher order components gets really annoying after a while.

Re: React Router v5

#50
post #39

I advise everyone to move away from React Router. Maintainers who have such blatant disregard for users should not be rewarded or celebrated.

How is you using someone else's open source package "rewarding" them?

I think that when someone provides an open source project they are doing everyone a favour. We then have a choice not to use it. But using their free thing is certainly not doing them a favour unless we are somehow contributing back.

Post reply on HN