San*_*ran 5 single-page-application navigation-drawer reactjs react-router material-ui
我试过使用 Component={Link} to={path} 但这只是改变了 URL。内容显示在 main 中,我在里面使用了 Routes ,如下所示:
<main>
<Switch>
<Route path={..} component={..}>
.
.
.
</Switch>
</main
Run Code Online (Sandbox Code Playgroud)
但这不起作用,内容不会改变
链接到材质 UI 示例:https : //codesandbox.io/s/v66pl
Ole*_*leg 11
根据您的要求添加到您的样本中:BrowserRouter, Link。
https://codesandbox.io/s/material-demo-605w9