react router - How do I access action and history from BrowserRouter in Matched route (v4)? -
i'm using react router v4 , using browserrouter.
this screenshot here shows browserrouter's props have action="pop"
.
however, when route matched in screenshot above, registermatch or matchprovider not receiving action, history, etc. via props.
i see via https://github.com/reacttraining/react-router/blob/v4/website/components/fakebrowser/index.js#l96 there might need injection of these props, i'm not able make sense of or make work.
using <router />
history prop or <browserrouter />
basename prop solves this. e.g. <router history={history}>
<browserrouter>
ignores history prop. use custom history, ' + 'use import { router }
instead of import { browserrouter router }
.
Comments
Post a Comment