我有一个标题,我想在某些页面上显示。所以我把我想要的页面包裹在 a 周围<></>并且成功了。但“NotFound”页面现在永远不会显示,并且标题位于空白页面上,而不是“未找到”页面上。我做错了什么以及如何解决它?
<Switch>
<Route path='/login' component={Login}></Route>
<Route path='/signup' component={SignUp}></Route>
<>
<Header />
<Route path='/cool-page' component={Cool}></Route>
<Route path='/another-page' component={Another}></Route>
<Route path='/' exact component={() => <Redirect to='/cool-page'></Redirect>}></Route>
</>
// This never get called...
<Route path='/' component={NotFound}></Route>
</Switch>
胡说叔叔
智慧大石
小唯快跑啊
一只名叫tom的猫
相关分类