React中设置404页面

<Switch>
                                <Redirect exact={true} from="/" to="/home"></Route>
                                <Route path="/home" component={HomeCom}></Route>
                                <Route path="/monitor" component={MonitorCom}></Route>
                                <Route path="/workbench" component={WorkbenchCom}>
                                <Route component={NotFound}></Route>
</Switch>

  

posted @ 2020-10-18 22:54  Samve  阅读(269)  评论(0编辑  收藏  举报