Hello, community!
I am having a problem using a ReasonReact component with Gatsby and the Netlify CMS. It is a reducerComponent, and was working fine until I tried to add props. Now I am having this error:
190 │
191 │ let default =ReasonReact.wrapReasonForJs(~component, jsProps =>
192 │ make(
193 │ ~holidays=jsProps->holidaysGet,
194 │ [||],
This function has type
'a =>
ReasonReact.componentSpec(state, state, ReasonReact.noRetainedProps,
ReasonReact.noRetainedProps, action)
It only accepts 1 argument; here, it's called with more.
The code looks like this:
type holiday = {
title: string,
body: string,
date: string,
holiday_type: string,
}
let component = ReasonReact.reducerComponent("Calendar");
let str = ReasonReact.string;
[@bs.deriving abstract]
type jsProps = {
holidays: list(holiday),
};
...
let make = _children => {
...
};
let default =ReasonReact.wrapReasonForJs(~component, jsProps =>
make(
~holidays=jsProps->holidaysGet,
[||],
)
);
That’s troubling because I copied the code directly from the docs https://reasonml.github.io/reason-react/docs/en/interop , only changed the prop name.
Do you know what I missed?
And on a related matter, once this works, how can I use the prop in the ReasonReact component? Can’t find documentation on this, in the docs, the type jsProps is defined after the component make
function, but I want to use the prop to display stuff in it. How?
Thanks in advance for your time!