求助!!react-router,为什么有时候在任意页面一回车就跳转到首页?

网站运行一段时间后,一回车,就会跳转到首路由,然后刷新之后有好了,请问是怎么回事?
以下是代码:

const history = createHashHistory();
const BasicRoute = () => (

<HashRouter history={history}>
    <Switch>
        <Route exact path="/" component={Login}/>
        <Route path="/home" component={Home}/>
        <Route path="/login" component={login}/>
    </Switch>
</HashRouter>

);
export default BasicRoute;

待解决 悬赏分:10 - 离问题结束还有 51天6小时58分42秒
反对 0举报 0 收藏 0

我来回答

回答3