不确定这是否足够的信息,但我有预感这就是问题所在,我如何写"到#34;
let categories = body.categories.map((category) => {
return ( <div className="eachCategory" key = {category._id} onClick = {(e) => this.updateHistoryAndSearch({tree: body.tree,category: category._id})}>
<Link to={`/Browse/${category._id}`}> {category._id} </Link>
</div>
)
})
在单独的页面上,我的路线看起来像
<Route path={"/Browse/:category"} component={this.Lectures} />