我已经为单独的基本名称创建了多个BrowserRouter,但是当我尝试实现404路由时,它将显示在每个路由组件的下方
<BrowserRouter basename={Modules.inbox}>
<div classname="AppRouting">
<Switch>
<SecretRoute exact path={CommunicationRoute.inbox} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.inbox + '/:slug'} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.settings} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.sending} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.trash} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.storage} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.blockWords} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.signature} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.defaultContent} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.rejectedMail} component={CommunicationRouting} />
<SecretRoute exact path={CommunicationRoute.routingRules} component={CommunicationRouting} />
</Switch>
</div>
</BrowserRouter>
<BrowserRouter basename={Modules.project} history={history} >
<div classname="AppRouting">
<Switch>
<SecretRoute exact path='/' component={Timesheet} />
<SecretRoute exact path='/fill-timesheet' component={Timesheet} />
<SecretRoute exact path="/(new-timesheet|serverError|open-task|thank-you|network-error)/" component={Timesheet} />
<BlockTimesheetRoute exact path='/block-fill-timesheet' component={Mtimesheet} />
<BlockTimesheetRoute exact path="/(block-timesheet|serverError|block-open-task|mthankyou|network-error)/" component={Mtimesheet} />
<SecretRoute exact path="/project-detail" component={ProjectList} />
<SecretRoute exact path="/my-timesheet" component={Timesheet} />
<SecretRoute exact path='/calender' component={Dashboardcalendar} />
<SecretRoute exact path='/review-timesheet' component={ReviewApprove} />
<SecretRoute exact path='/review-timesheets' component={ReviewApprove} />
<SecretRoute exact path='/timesheets-view' component={ReviewApprove} />
</Switch>
</div>
</BrowserRouter>
<BrowserRouter>
<Switch>
<Route component={NotFound} />
</Switch>
最后一个组件始终显示所有路线,因为每个模块都有一个单独的基本名称,所以我无法创建一个浏览器路线