1. index.js文件中查看App组件是否被包裹在<BrowserRouter></BrowserRouter>之中。
2. <Switch>下的<Route exact path="" component={}/> 添加exact。
+ react-router 的安装 yarn add react-router-dom
1. index.js文件中查看App组件是否被包裹在<BrowserRouter></BrowserRouter>之中。
2. <Switch>下的<Route exact path="" component={}/> 添加exact。
+ react-router 的安装 yarn add react-router-dom