Hi there! I would like to create ReasonML bindings for a mapbox-gl
package. Mapbox requires an accessToken
to be provided before you can use a library. The proper way to provide this token is to set accessToken
on mapbox-gl
import.
import mapboxgl from 'mapbox-gl';
mapboxgl.accessToken = '...';
I’ve created following bindings:
[@bs.module "mapbox-gl"] [@bs.val]
external accessToken: ref(string) = "accessToken";
But then I try to set accessToken
with
MapboxGL.accessToken := "...";
I’m getting Uncaught TypeError: Cannot set property '0' of null
. Am I missing something?