如何使用带有 Material UI 抽屉的 React Router 来更改点击时的内容?
How to use React Router with Material UI Drawer to change content on click?
我试过使用 Component={Link} to={path} 但这只是改变了 URL。
内容显示在 main 中,我在其中使用了路由,如下所示:
<main>
<Switch>
<Route path={..} component={..}>
.
.
.
</Switch>
</main
但这不行,内容没有变化
Link 到 material UI 示例:https://codesandbox.io/s/v66pl
已按您的要求添加到样本中:BrowserRouter
、Link
。
我试过使用 Component={Link} to={path} 但这只是改变了 URL。 内容显示在 main 中,我在其中使用了路由,如下所示:
<main>
<Switch>
<Route path={..} component={..}>
.
.
.
</Switch>
</main
但这不行,内容没有变化
Link 到 material UI 示例:https://codesandbox.io/s/v66pl
已按您的要求添加到样本中:BrowserRouter
、Link
。