I'm using react-leaflet v.2.8 in my project. I want to upgrade the react-leaflet to v.3. But how? When I write "npm i react-leaflet", it installed only react-leaflet v.2.8.
Asked
Active
Viewed 525 times
0
-
1Try to typing `npm i react-leaflet@latest`. – Vagner Wentz Jul 12 '21 at 17:16
1 Answers
0
One way:
npm uninstall react-leaflet
npm install react-leaflet
Another way:
Go to your package.json, and change whatever version number react-leaflet has to the latest one that is listed on npm. It should then look like this in the package.json:
"react-leaflet": "^3.2.0"
Then run npm install react-leaflet
Keep in mind there are lots of breaking changes from version 2 to version 3, so be prepared to update your codebase.

Seth Lutske
- 9,154
- 5
- 29
- 78