0

Good day,

I want to try out Leaflet in React, but have not gotten far. I have installed react-leaflet using these steps:

npm install leaflet
npm install react react-dom leaflet
npm install react-leaflet

After that, I tried to run this in my React App (it's the simple example on the website):

import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";

<MapContainer center={[51.505, -0.09]} zoom={13} scrollWheelZoom={false}>
      <TileLayer
        attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
        url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
      />
      <Marker position={[51.505, -0.09]}>
        <Popup>
          A pretty CSS3 popup. <br /> Easily customizable.
        </Popup>
      </Marker>
</MapContainer>

This resulted in a lot of errors: Errors1 Errors2

How do I resolve these errors?

CarlaVdB
  • 165
  • 11

0 Answers0