这是我的代码:
class noMatch extends React.Component {
render() {
return 'Not Found'
}
}
ReactDOM.render(
<BrowserRouter>
<Switch>
<Route exact path='/(index.html)?' component={App}/>
<Route component={noMatch}/>
</Switch>
</BrowserRouter>,
mountNode
);
该应用程序按预期在 localhost:3000/ 和 localhost:3000/index.html 中运行。但是当没有匹配时,我的 no Match 不会渲染?我正在关注此处文档中的 noMatch 教程。帮助?