You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moduleShouldAllowComponentProp=
struct
letmake=letbrisk-component=Brisk_reconciler.Expert.component ~useDynamicKey:false"test/Components.re.ShouldAllowComponentProp.make" in
fun ?(key= Brisk_reconciler.Key.none) ->
fun ~component ->
fun() ->
brisk-component ~key
(funhooks ->
(((letbrisk-component = Div.makein
((brisk-component
~children:(Brisk_reconciler.Expert.jsx_list[component]) ())
[@JSX ])), hooks) :nodeelement))
end
Which produces the type error:
File "test/Components.re", line 239, characters 4-35:
239 | (<Div> component </Div>, hooks);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type 'a * 'b
but an expression was expected of type node element
moduleShouldAllowComponentProp=
struct
letmake=letbrisk-component=Brisk_reconciler.Expert.component ~useDynamicKey:false"test/Components.re.ShouldAllowComponentProp.make" in
fun ?(key= Brisk_reconciler.Key.none) ->
brisk-component ~key
(fun ~component ->
fun() ->
funhooks ->
((letbrisk-component = Div.makein
((brisk-component
~children:(Brisk_reconciler.Expert.jsx_list[component]) ())
[@JSX ])), hooks) : ?key:int ->
component:nodeelement ->
unit -> nodeelement)
end
Which produces the error:
File "test/Components.re", line 240, characters 4-62:
240 | (~component, (), hooks) => (<Div> component </Div>, hooks);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This function should have type
?key:int -> component:node element -> unit -> node element
but its first argument is labelled ~component
The text was updated successfully, but these errors were encountered:
Type annotations on
let%component
functions are transformed to apply to only the return value, not the entire function.1. Annotation of return type
Transforms to:
Which produces the type error:
2. Annotation of entire function type
Transforms to:
Which produces the error:
The text was updated successfully, but these errors were encountered: