在此代码中
import React from 'react'
import {
BrowserRouter as Router,
Route,
Link
} from 'react-router-dom'
const Home = () => (
<div>
<h2>Home</h2>
</div>
)
const Topic = ({ match }) => (
<div>
<h3>Topic</h3>
</div>
)
const Topics = ({ match }) => (
<div>
<Route path={`/aaa`} component={Topic}/>
</div>
)
const BasicExample = () => (
<Router>
<div>
<ul>
<li><Link to="/">Home</Link></li>
<li><Link to="/topics">Topics</Link></li>
</ul>
<hr/>
<Route exact path="/" component={Home}/>
<Route path="/topics" component={Topics}/>
</div>
</Router>
)
export default BasicExample
我在链接&#34; / aaa&#34;下注册的组件Topic
永远不会被渲染。
我尝试了两种方法但没有一种方法:
Topic
组件。任何人都可以解释原因吗?