There seems to be no special handling of optional arguments for external%component, which means that optional arguments are passed in as option values.
my_component () will cause 0 to be passed as num_leprechauns.
my_component ~num_leprechauns:42 () will cause [0, 42] to be passed as num_leprechauns.
It might be sufficient to convert the option value to a Js.optdef value, but I think the proper solution is to omit it from the props object if the argument is not passed. I'll try doing the simpler thing for now though.
There seems to be no special handling of optional arguments for
external%component
, which means that optional arguments are passed in asoption
values.Given
my_component ()
will cause0
to be passed asnum_leprechauns
.my_component ~num_leprechauns:42 ()
will cause[0, 42]
to be passed asnum_leprechauns
.It might be sufficient to convert the
option
value to aJs.optdef
value, but I think the proper solution is to omit it from the props object if the argument is not passed. I'll try doing the simpler thing for now though.