How to link page with React Router v1.0.0

I want to associate a specific section of a page section with a responsive router in much the same way that anchor tags will work in html. However, I could not find a solution with React Router version 1.0.0.

I currently have my router:

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>

and I'm trying to reference a specific section in components like

 <Link to="/b#{div_id}"> Go to section with div_id is component {b} </Link>
+4
source share
1 answer

There is currently an open issue for GitHub . It is not supported, but it should be supported in use HistoryLocationwhen this problem is fixed.

EDIT

This is no longer supported .

+1

Source: https://habr.com/ru/post/1616419/


All Articles