below is the code that binds the react component.
module Content = {
@module("@radix-ui/react-dialog") @react.component
external make: (
~children: React.element,
~className: string=?,
~ref: ReactDOM.Ref.t=?,
~onPointerDownOutside: ReactEvent.Mouse.t => unit=?,
~onOpenAutoFocus: ReactEvent.Pointer.t => unit=?,
) => React.element = "Content"
}
And here’s the code I want to apply the default value.
module Content = {
@module("@radix-ui/react-dialog") @react.component
external make: (
~children: React.element,
~className: string=?,
~ref: ReactDOM.Ref.t=?,
~onPointerDownOutside: ReactEvent.Mouse.t => unit=?,
~onOpenAutoFocus: ReactEvent.Pointer.t => unit={ReactEvent.Synthetic.preventDefault},
) => React.element = "Content"
}
I used code like
@as(json`{ onOpenAutoFocus : e => e.preventDefault() }`) _
to apply the default value, but it didn’t work.