2015-11-18 106 views
4

我想鏈接到頁面的具體部分與反應路由器很多像錨定標籤如何在HTML中工作。但是,我找不到React Router版本1.0.0的解決方案。如何鏈接到一個頁面與反應路由器v1.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

查看我的更新,這不會被支持 – Tyrsius

+0

有什麼辦法可以用React去頁面的某個部分呢? –

+0

看看[這個答案](http://stackoverflow.com/questions/30495062/how-can-i-scroll-a-div-to-be-visible-in-reactjs) – Tyrsius

回答

1

目前在GitHub一個開放的問題爲了這。它似乎不受支持,但在解決此問題時使用HistoryLocation時應該受支持。

編輯

這是no longer supported

+1

我看到了那個鏈接,我想他們已經修復了它。感謝您確認它仍然不受支持 –

相關問題