I have a react element that has:
type opt = {label:string, value:string}
type props = { label?: string, value?: string, data: array<opt>}
because rescript figures out the type from the record fields when i want to provide the options it thinks im passing an array of props instead of opts.
i solved it doing:
{
let opt: MyElement.opt = {......}
opt
}
the question is is there a way of returning a record of a specific type without creating a variable and then returning it?
i tried MyElement.opt {…} but it does not work