我想链接到具有反应路由器的页面的特定部分部分,就像锚标记在html中的工作原理一样。但是,我找不到React Router版本1.0.0的解决方案。
目前,我的路由器是这样的:
let history = createHashHistory({
queryKey: false
});
<Router history={history}>
<Route path="/" component={a}/>
<Route path="/b" component={b}/>
<Route path="/c" component={c}/>
<Route path="/d" component={d}/>
<Route path="/e" component={e}/>
<Route path="/f" component={f}/>
<Route path="/g" component={g}/>
</Router>
我试图链接到组件中的特定部分,如
<Link to="/b#{div_id}"> Go to section with div_id is component {b} </Link>
答案 0 :(得分:1)