nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

Added EventDispatcher to dispatch events #1508

Closed lLenn closed 5 years ago

lLenn commented 5 years ago

I'm using expo and had issues with events not triggering because they don't implement ReactApplication. I've changed the code so that it's based off of standard React-Native components and in my opinion this is the proper way to dispatch events. This triggers the events properly with expo, but also for normal react-native projects.

1189

kristfal commented 5 years ago

@lLenn, thanks for your contribution, this looks good. As you may have noticed, we have a workaround in place for reconnecting when the JS side is reloaded. I'm not very well versed on the Android side, so can you just verify/confirm that reloading the JS bundle reconnects properly? Thanks

lLenn commented 5 years ago

@kristfal, yes, that was the problem I encountered aswell, but your patch only worked for normal rn projects. Now it works for expo projects aswell.

kristfal commented 5 years ago

Very good. Lgtm.