[英]how to link in a page with React Router v1.0.0
我想鏈接到一個頁面的特定部分與反應路由器很像錨標簽在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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.