It’ll probably be more ergonomic to use the @as
annotation instead, which would let you use whatever name you wanted within rescript, e.g.:
type sourceData = {
@as("type")
type_: string,
geometry: sourceDataGeometry,
}
module Source = {
@module("react-map-gl") @react.component
external make: (
~id: string,
@as("type")
~type_: string,
~data: sourceData,
~children: React.element,
) => React.element = "Source"
}
<ReactMapGL.Source id="tenMilesTrail" type_="geojson" data={tenMilesData}>