Binding to the "type" prop

reasonreact

#1

I want to bind to an external javascript button component that has the prop: “type”.

[@bs.module "path/to/button.js"] [@react.component]
external make:
  (
    ~children: React.element,
    ~variant: string,
    ~color: string,
    ~onClick: ReactEvent.Form.t => unit,
    ~type: string
  ) =>
  React.element =
  "default";

Is there a way to achieve this with @react.component and without having to use the makeProps syntax?


#2

The convention for FFI is that if you add a underscore, bucklescript will simply ignore it

So try _type instead


#3

Worked, Thank you!