geoman-io/leaflet-geoman

Types fix (for crucial for react-leaflet users)

Open

#1515 opened on Sep 19, 2024

View on GitHub
 (6 comments) (0 reactions) (0 assignees)JavaScript (1,933 stars) (404 forks)batch import
help wantedtypescript

Description

Hey! I'm using the free version with react-leaflet, and all seems to work quite well but there is one main problem which is types of event handlers. The type definitions for pm event is on interface Evented, while for react-leaflet users, the event handler's prop type (which are passed to each layer's component) are inferred LeafletEventHandlerFnMap. So far, I have built my own leaflet.d.ts file to extend the type infer to match what geoman is adding. I'd for it to come by default or listen to other possible solutions from the community

Contributor guide