react-router和react-router-dom

react-router-dom中的Route.js和Router.js, 都是直接导入的react-router中的Route.js和Router.js。react-router提供的是路由的基本功能, react-router-dom根据在浏览器运行时路由的特征,在react-router之上做了一层封装, 提供了HashRouter. BrowserRouter等在web端常用的路由。如果是在web端使用的话,package.json中直接引入react-router-dom就可以。

猜你喜欢

转载自blog.csdn.net/qq_45830543/article/details/109538486