英文:
Is there another way of routing in React-JS/React-TS beyonds the library react-router-dom@latest?
问题
我正在进行一个前端项目。
我需要设置路由网络。
我发现了 react-router-dom@latest。
我想知道是否还有其他选项。
因为 JavaScript 是开源的。
所以我认为其他人可能已经创建了另一种路由方式。
英文:
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.
答案1
得分: 2
我强烈建议你选择react-router-dom
。但据我所知,你还有两个备选方案:
=> Reach Router:
Reach Router:Reach Router是一个主要关注无障碍性的路由库。Reach Router旨在提供更简单、更可预测的路由体验,但仍处于实验阶段。
以下是你可以探索的一些链接:
-
官方文档:https://reach.tech/router/
-
https://github.com/reach/router/tree/d2c9ad06715c9d48c2d16f55f7cd889b626d2521/website/src/markdown
=> 第二个备选方案是你可以开始使用Next.js,它是建立在ReactJS之上的,包括内置的路由功能。它提供了一个易于使用的基于文件的路由系统,其中每个页面都由一个React组件表示。
英文:
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
=> 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.
答案2
得分: 1
React-router-dom是React JS官方推荐的,这也是最常用的包。你可以在https://www.npmjs.com/search?q=keywords:routing上探索更多包。例如,有一个叫做react-easy-router的包也被很多人使用。所以我猜对于React来说,路由包没有限制,并且不能保证react-router-dom是最简单的包。可能还有更简单的包,只是人们更习惯使用它。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论