vasansr / pro-mern-stack

Code Listing for the book Pro MERN Stack
http://www.apress.com/in/book/9781484226520
343 stars 159 forks source link

Import Router, Route, Link from react-router doesn't work. Must use react-router-dom. #3

Open love4code opened 7 years ago

love4code commented 7 years ago

Use react-router-dom

Also, This will require a complete refresher on routing because the routing has some differences. If in dire need of filler material I found a short video tutorial series free on egghead.io

https://egghead.io/lessons/react-use-the-react-router-v4-link-component-for-navigation-between-routes

vasansr commented 7 years ago

Thanks! Yes, if you are using react-router latest versions (4 or above), the client-side specific stuff has been separated out to react-dom. You could follow the tutorials available (like the one referenced in the issue report), but I suggest you follow the version of react-router that was used while writing the book. In this case, it would be 2.7.0. The command line for installing this version is:

npm install --save-dev react-router@2.7.0