reactjs - Relative Linking with React-Router -


how it? when part of path param (:someparam). can't find in documentation.

it's recommended use react-router 3 scenario https://github.com/reacttraining/react-router/issues/3325

for having problem react-router 2.x:

you may use browserhistory support relative routes, instead of using link component.

    // assuming http://site/myanimals      // configure router hosting in subdirectory     const history = userouterhistory(createhistory)({        basename: '/myanimals'     });      // use ...     import {browserhistory} 'react-router';      browserhistory.push('about');      // or, configured route 'animal/:id' can use       // <route path={'animal:id'} .../>                browserhistory.push('animal/3'); 

i hope helps!


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -