What Is the Difference Between Browserrouter(Import from React-Router-Dom) and Connectedrouter(Import from Connected-React-Router/Immutable)?
import { ConnectedRouter } from 'connected-react-router/immutable';
import { BrowserRouter as Router,} from 'react-router-dom';

i need to know difference between above both of them.

2 Answers

ConnectedRouter is to be used with Redux and can synchronize router state with a Redux store.
BrowserRouter is the 'standard' React router for the browser, to keep the UI in sync with the current URL.

The main difference in connected-react-router/immutable in is that history is stored in redux as immutable object so you can timetravel your history any time in the redux-life of the application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest