I am trying to update history in react
when the user navigates from one page/route to another. But confused about what method I should use to achieve this and why?
import { browserHistory } from 'react-router'
browserHistory.push('/bag')
OR
import { routerMiddleware, push } from 'react-router-redux'
const middleware = routerMiddleware(browserHistory)
const store = createStore(
reducers,
applyMiddleware(middleware)
)
store.dispatch(push('/bag'))
Please help. Thanks in advance :)