Always check the JS output.
When compiled in ES6 mode, the output of the example above looks like this:
import Moment from "moment";
import * as ReactBigCalendar from "react-big-calendar";
var Localizer = {};
var ReactBigCalendarBindings = {};
var localizer = ReactBigCalendar.momentLocalizer(Moment);
This looks like the correct output according to the react-big-calendar README.
Running npm install react-big-calendar was not suffisant, I had to install manually some dependencies that I don’t have to when using react-big-calendar in classic react+js. (packages : emitter, popper, stream)
May be it has to do with dependencies not resolved ?
There is also this stange behavior, I pass an empty list to events and the compiler turns it to 0, any idea why ?
A list is a variant, so it mostly* follows the same rules as any other variant. Think of an empty list ([] in Reason, list{} in ReScript), as the name of a variant constructor. Just like any other variant constructor without a payload, it’s represented as an integer when it’s compiled.
*It’s a special variant defined by the compiler, so it does enjoy a few minor features that regular, user-defined, variants don’t.
With this in mind, list is not a shared data type, so you should probably never use it in an external binding. You need to use array, which is not the same thing.