How to include “leaflet.css” in a React app with webpack?

前端 未结 6 1742
忘掉有多难
忘掉有多难 2021-01-19 02:09

I using the survivejs.com site as a template to build a map based React app with webpack. For the map i am using leaflet but i can\'t find a way to add the leaflet.css. With

6条回答
  •  甜味超标
    2021-01-19 02:23

    This code worked for me.

    1/ Import leaflet.css directly from leaflet (located inside of node_modules)

    2/ Add useEffect, where replace map marker icons (by default markers were not visible, after leaflet.css import)

    3/ Render any leaflet components

提交回复
热议问题