0

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.

A7x
  • 383
  • 3
  • 15

1 Answers1

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