I’m working on a frontend project.
I need to set the net of routes.
I’ve found that there the react-router-dom@latest.
I’d like to know if there’s another option.
Because, JS a opensouce.
So I thought someone else could’ve created another to route.
2
Answers
I strongly urge you to go with the
react-router-dom
. but, still as far as I know, You can go with these 2 alternatives:=> Reach Router:
Reach Router: Reach Router is a routing library that mainly focuses on accessibility. Reach Router aims to provide a simpler and more predictable routing experience but still in the experimental phase.
Here are the few links you can explore:
Official Documentation: https://reach.tech/router/
https://github.com/reach/router/tree/d2c9ad06715c9d48c2d16f55f7cd889b626d2521/website/src/markdown
https://www.npmjs.com/package/@reach/router
=> Second alternative is you can start using Next.js which is built on top of ReactJS and includes built-in routing capabilities. It provides an easy-to-use file-based routing system, where each page is represented by a React component.
React-router-dom was recommended officially by React JS which why it is the most commonly used package. You can explore more packages at https://www.npmjs.com/search?q=keywords:routing. For example there is a package called react-easy-router which is being used by many people too. So I guess there is no limitation on the routing packages for React, and there is no guarantee that react-router-dom is the easiest package out there. There might be more simpler packages too, its just that people are more comfortable using it.