What's the benefit of upgrading to React Router v6 #8599
-
This is a major upgrade and big disruption for many mature codebases. I see lots of seemingly needless renaming and updates that don't provide much value. Can someone please tell me the benefits to upgrading from v5 to v6? CONS:
PROS:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
I hope other devs who reviewed v6 can provide their thoughts on this. After reviewing the pros and cons for a large web application I'm refactoring, there is no benefit in upgrading. Rather I cannot upgrade because:
|
Beta Was this translation helpful? Give feedback.
-
As others have correctly mentioned in certain issues, React Router 6 is a new router philosophy, not a major version increment. Many of the design choices either seem to be simplistic/lacking in maturity or are done with complete disregard for the current consumer-base. The changes are dictated, meaning that despite this being open-source, there is no room for architectural discussion - this is characteristic of Facebook OS projects and I'm just not interested. It's now on people like me to explain to a commercial business why the development teams needs to spend x weeks implementing and testing a new routing framework for our application which has hundreds of routes. |
Beta Was this translation helpful? Give feedback.
-
I agree totally with @WoodyWoodsta and I regret upgrading to v6. I feel like they should have be more clear about their intent. |
Beta Was this translation helpful? Give feedback.
-
Does the v6.4 version fix any shortcoming mentionned in this discussion, especially the flickering on redirect? |
Beta Was this translation helpful? Give feedback.
-
This is great feedback.
Typically people want this to navigate outside of the react render tree and that was unsafe because of React's concurrent mode would get the UI out of state with your history object. We wanted to be forward compatible so we just hid history until the React team had an answer. React 18 shipped More information here: #8264 (comment)
We're bringing this back. It was always broken. Will still be broken, but not as much. More information here: #8139 (comment)
We're bringing those back. More information here: #9550 Appreciate everybody's patience here! Covid threw our business for a loop. We always intended to figure these three things out but had to get back on our feet again. That time is now!
Totally. We regret this but like I said, rough times. We now have the resources and time to be more involved with the community to make sure upgrading is worth it and not difficult 🤗 |
Beta Was this translation helpful? Give feedback.
This is great feedback.
Typically people want this to navigate outside of the react render tree and that was unsafe because of React's concurrent mode would get the UI out of state with your history object. We wanted to be forward compatible so we just hid history until the React team had an answer.
React 18 shipped
useExternalSyncStore
which fixed the problems. Now you can userouter.navigate
in v6.4 to safely navigate outside of the react tree.More information here: #8264 (comment)
We're bringing this back. It was always broken. Will still be broken, but not as much. More information here: #8139 (comment)
W…