Catalog
  1. 1. 什么是React路由?有什么优点?
  2. 2. 常用的路由
  3. 3. 推荐阅读
什么是React Router?它有哪些优点

什么是React路由?有什么优点?

  • 什么是React路由

    • React Router 是一组 React 的导航组件,用来处理路由跳转
  • 优点

    • 不需要手动设置路由历史,直接将程序包在BrowserRouter组件中即可
    • 在低版本的浏览器中使用HashHistory即可
    • 在非dom环境中也有对应的组件,即MemoryHistory
    • 可以通过组件、配置对象来配置组件
    • 可以通过link、redirect来进行路由切换
    • 可以很方便的完成按需加载

常用的路由

推荐阅读

Author: Erealm
Link: http://erealmsoft.github.io/2019/09/26/react/react-router/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment