萌新请问,如果我这样设置了route,是不是永远也无法跳到404页面了?
Route无法跳到404页面
oyb81076
#5
<Route path="/notMatch" />
<Route path="/" component={MyLayOut}/>
function MyLayout(){
return (
<>
<header />
<Switch>
<Route path="/prod" />
....
<Redirect to="/notMatch" />
</Switch>
</>
)
}
zhangyuhuihh
#6
在这种配置了根 ‘/’ 路径之后的路由,是不是意味着已经无法再使用
<Redirect from="/" to="/login" />
这种从根’/'路径的Redirect重定向了?
也就意味着一定要在myLayout加上一个中间路由:<Route path="/main" component={MyLayOut}></Route>
以区分开?