我正在寻找这个,但我找不到正确的答案。是否可以在 React Component 中像这样使用 React Router;
import { Route, Switch } from 'react-router'
import LandingLayout from '../../layouts/landing/LandingLayout'
import AppLayout from '../../layouts/app/AppLayout'
<Switch>
<LandingLayout>
<Route path="/" exact="true" component={Home} />
<Route path='/login' component={Login} />
<Route path='/signup' component={Signup} />
</LandingLayout>
<AppLayout>
<Route path='/dashboard' component={DashboardPage} />
<Route path='/users' component={UserList} />
<Route path='/u/:username' component={AccountPage} />
</AppLayout>
<Route component={NotFound} />
</Switch>