What is the difference between BrowserRouter(import from react-router-dom) and ConnectedRouter(import from connected-react-router/immutable)?

Viewed 8355
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.

Related