With react-router
I can use the Link
element to create links which are natively handled by react router.
I see internally it calls t
Those who are facing issues in implementing this on react-router v4.
Here is a working solution for navigating through the react app from redux actions.
history.js
import createHistory from 'history/createBrowserHistory'
export default createHistory()
App.js/Route.jsx
import { Router, Route } from 'react-router-dom'
import history from './history'
...
another_file.js OR redux file
import history from './history'
history.push('/test') // this should change the url and re-render Test component
All thanks to this comment: ReactTraining issues comment