Closed
Description
Original
type inputRef = {bla: string}
module ForwardRef = {
@react.component
let make = React.forwardRef((ref: Js.Nullable.t<React.ref<inputRef>>) => { // type annotation for ref
React.useImperativeHandle1(
ref,
() => {
bla: "bla",
},
[],
)
React.null
})
}
Output with type annotation
type inputRef = {bla: string}
module ForwardRef = {
type props<'ref> = {ref?: 'ref}
let make = (_: props<React.ref<inputRef>>, ref: Js.Nullable.t<React.ref<inputRef>>) => {
React.useImperativeHandle1(
ref,
() => {
bla: "bla",
},
[],
)
React.null
}
let make = React.forwardRef({
let \"Bigint$ForwardRef" = (props: props<_>, ref) => make(props, ref)
\"Bigint$ForwardRef"
})
}
Output without type annotation
type inputRef = {bla: string}
module ForwardRef = {
type props<'ref> = {ref?: 'ref}
let make = (_: props<ReactDOM.Ref.currentDomRef>, ref) => {
React.useImperativeHandle1(
ref,
() => {
bla: "bla",
},
[],
)
React.null
}
let make = React.forwardRef({
let \"Bigint$ForwardRef" = (props: props<_>, ref) => make(props, ref)
\"Bigint$ForwardRef"
})
}
Metadata
Metadata
Assignees
Labels
No labels