Closed pincman closed 3 years ago
代码
import { BasicLayout } from './layouts'; import Dashboard from './pages/dashboard/welcome'; const App = () => ( <Router> <CacheSwitch> <CacheRoute exact path="/" component={BasicLayout} /> <Route exact path="/p" component={Dashboard} /> <Route render={() => <div>404 Not Found</div>} /> </CacheSwitch> </Router> ); export default App;
报错index.js:176 Uncaught ReferenceError: useHistory is not defined
index.js:176 Uncaught ReferenceError: useHistory is not defined
react-router-dom 的版本是多少?
@CJY0208 5.2.0
需要先检查一下业务代码中是否有未定义的 useHistory 方法,检查了代码,不像是 cache-route 内部的问题
可以尝试提供在线或者 github demo 来便于分析
无反馈,暂时关闭
代码
报错
index.js:176 Uncaught ReferenceError: useHistory is not defined