rescript-react-native / image-picker

ReScript bindings for react-native-image-picker
MIT License
8 stars 2 forks source link

Bindings don't work with ES6 #6

Closed JulesGuesnon closed 3 years ago

JulesGuesnon commented 3 years ago

Hello !

First of all, thanks for your work on these bindings !

Because of the default scope:

  @module("react-native-image-picker") @scope("default")
  external launchCamera: (Options.t, response => unit) => unit = "launchCamera"

  @module("react-native-image-picker") @scope("default")
  external showImagePicker: (Options.t, response => unit) => unit = "showImagePicker"

  @module("react-native-image-picker") @scope("default")
  external launchImageLibrary: (Options.t, response => unit) => unit = "launchImageLibrary"

Rescript get transpiled to:

ReactNativeImagePicker.default.whatever 

But as Rescript-React-Native/Template comes with ES6:

"package-specs": {
    "module": "es6",
    "in-source": true
  },

Shouldn't the @scope("default") be remove ?

MoOx commented 3 years ago

Yes indeed it looks like a bug. Fixed in 2.3.6.