React Router version 6 was released recently, and it is important for us to understand the changes as it is one of the most widely used react libra...
For further actions, you may consider blocking this person and/or reporting abuse
Hey @arunavamodak , liked this blog. Crisp content ; differences of the versions as well as the new implementation is dealt very well.
As someone who hasn't used React Router, what's the advantage of using this over a framework like Next.js or Gatsby?
Well it totally depends on the requirement of your project.
If you want an SPA, you can use React and React Router, which takes care of your client-side routing. For something like Next.js it comes with it's own page based routing, I don't think we can implement SPA.
React Router is directly plugged into Next without you having to install it as a separate dependency. For instance, with Next when you add a new JS/TS or JSX/TSX file into the pages folder, it will automatically map out the path for you without you having to define it.
I don't think there is an advantage of using React Router over Next.js or Gatsby. If you want the tools that Next or Gatsby offer then it makes sense to just go for those. If you're working on a more vanilla React project then you will generally see something like React Router in place to handle the routing.
Next and Gatsby are full-fledged frameworks and do a LOT more than just routing. If you're already using them, there's no need to use React Router.
Hey Arunava, Thanks for such nice and detailed explanation about the changes in react-router v6.
Thanks man. Just looking to contribute something to the community
Very nice article! Also a good video tutorial from Academind youtu.be/zEQiNFAwDGo
quality sharing!
nice👏
At some point can you add in built-in Protected Routes? It would be quite the convenience feature. Otherwise this looks great!
Thanks for the great post!!!
There's also an official upgrading guide: github.com/remix-run/react-router/...
very good explanation 👌
Thank you !
Thanks Arunava Modak for make it so easy.