I am currently porting some code over to a ReScript project, and in the original, the <marquee> tag is used. Now I notice that in the definitions none of the props are actually listed.
My question is: how do you extend/inject into ReScript’s existing types? I’d like to add these props myself or just dismiss the error.
Thinking about to create a PR to add some standard html attributes to the props type.
Since there are two different types (ReactDOM.domProps and JsxDOM.domProps) I don’t know which one is the right one.
In the react repo, I see some deprecation warnings, but they doesn’t make sense for me.
module Props = {
@deprecated("Please use type ReactDOM.domProps")
type domProps = JsxDOM.domProps
/** DEPRECATED */
@deriving(abstract)
@deprecated("Please use type ReactDOM.domProps")
type props = {
...
}
}
There are also the action and formAction attributes extended by the React library which e.g. Next.js uses to perform RPCs as part of their server actions. I am not sure, if this also qualifies as a welcome PR.
I pasted some sample code here where I replicated the basis of this video.
Maybe someone can chime in to let me know if I am on the right track with the type definitions. I also tried to use a polymorphic variant for the actionType but hat trouble to completely unbox the value needed as input for the action attribute.
I would make the callback return promise<unit> since it’s likely the most common signature instead of 'a. The real issue comes from the input of this callback function, you can’t make its type depend on a dependency, the cleanest solution would likely to add a type formData to runtime/Dom.res, we’ll see how we swap this with the experimental WebAPI bindings in the future. Apart from that, it looks ok!