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.
At the core of every React Router application should be a router component. For web projects, react-router-dom provides <BrowserRouter> and <HashRouter> routers. The main difference between the two is the way they store the URL and communicate with your web server. A <BrowserRouter> uses regular URL paths.
The primary difference between them lies in their usage. React Router DOM is for web applications and React Router Native is for mobile applications made with React Native.
React Router is a standard library for routing in React. It enables navigation between views from different components in a React application, allows the browser URL to be changed, and keeps the UI in sync with the URL.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With