Connected-react-router: Use react-router or react-router-dom?

Created on 27 Jun 2019  路  1Comment  路  Source: supasate/connected-react-router

Should I use react-router of react-router-dom?

I started my project using react-router-dom.

The step 3 in the documentation states:
import { Route, Switch } from 'react-router' // react-router v4/v5

Is there any difference if I use:
import { Route, Switch } from 'react-router-dom'; ?

Most helpful comment

react-router has all the common components for react-router-dom and react-router-native.
You should use react-router-dom if you are building for the web and it should have everything you need as it also exports the common components you'll need.
If you're using React Native, use react-router-native should have everything you need for the same reason.

>All comments

react-router has all the common components for react-router-dom and react-router-native.
You should use react-router-dom if you are building for the web and it should have everything you need as it also exports the common components you'll need.
If you're using React Native, use react-router-native should have everything you need for the same reason.

Was this page helpful?
0 / 5 - 0 ratings