Skip to main content

Setup

  1. Follow all the steps from the installation page
  2. Add the following code to your app and check it displays correctly:
Live Editor
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^

If the map is not displayed properly, it is most likely because you haven't followed all the prerequisites.

  1. Make sure all dependencies are installed and using supported versions
  2. Make sure Leaflet's CSS is loaded
  3. Make sure your map container has a defined height

If you're still having trouble, you can use the react-leaflet tag on Stack Overflow.