Fork me on GitHub
#cljsrn
<
2017-04-15
>
kurt-o-sys11:04:28

I'm trying out cljsrn/re-natal. I created a base project and got it working. However, I'd like to add https://github.com/airbnb/react-native-maps and I'm really lost how to make it work. I added it to index.android.js (developing for android first), and I tried this inside .../android/core.js:

(def map-box (js/require "react-native-mapbox-gl/MapView"))
I know I'm missing some things, but I don't see how to add custom components. I followed https://github.com/drapanjanas/re-natal#using-external-react-native-components , but it's a bit confusing, or well, it doesn't work: Unable to resolve module react-native-mapbox-gl/Mabpox from ...

kurt-o-sys12:04:26

$ ls node_modules/react-native* -alhd
drwxr-xr-x 13 kurt-personal kurt-personal 326 Apr  5 21:32 node_modules/react-native
drwxr-xr-x  5 kurt-personal kurt-personal 267 Apr  5 21:32 node_modules/react-native-mapbox-gl
So, the module is there... although the error message seems to tell otherwise?

kurt-o-sys12:04:40

I tried the steps proposed in the message and in https://github.com/facebook/react-native/issues/4968 - doesn't solve anything

benny16:04:39

@kurt-o-sys try just (js/require "react-native-maps")

benny16:04:05

Also notice the component is called "react-native-maps" (no gl)

kurt-o-sys16:04:05

well... thanks... I was actually using https://www.npmjs.com/package/react-native-mapbox-gl - don't know which map implementation to use actually, was just a quick test. I'll try again, thx.

benny16:04:40

Mapbox is a paid service

kurt-o-sys16:04:15

yeah... just discovered that one 😛. What about this one, seems to be new: https://github.com/uber/react-map-gl

benny16:04:31

Technically so is Google maps at some point but if you don't need customization I would recommend the basic one

benny16:04:14

Especially as you're trying to work it all out

kurt-o-sys16:04:16

yeah. right. It's just to play a little bit 🙂

benny16:04:12

Enjoy! RN and Renatal are fun

kurt-o-sys16:04:21

thx 🙂

kurt-o-sys16:04:16

Actually, I don't really understand why we need to provide an google API key to react-native-mapbox-gl . mapboxgl.js doesn't need it. So why is it actually necessary? (doesn't matter, I just wonder)

benny16:04:46

You only need a mapbox key not Google for the mapbox one