Skip to content

Commit 600eea2

Browse files
committed
fix uncurried external make for jsx v4
1 parent d703969 commit 600eea2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

res_syntax/cli/reactjs_jsx_v4.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,11 @@ let transformStructureItem ~config mapper item =
751751
config.hasReactComponent <- true;
752752
check_string_int_attribute_iter.structure_item
753753
check_string_int_attribute_iter item;
754+
let pval_type =
755+
match pval_type.ptyp_desc with
756+
| Ptyp_constr ({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, [t]) -> t
757+
| _ -> pval_type
758+
in
754759
let coreTypeOfAttr = React_jsx_common.coreTypeOfAttrs pval_attributes in
755760
let typVarsOfCoreType =
756761
coreTypeOfAttr

res_syntax/tests/ppx/react/expected/v4.res.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ module E = {
5252
}
5353

5454
module EUncurried = {
55-
type props = {}
55+
type props<'x> = {
56+
x: 'x,
57+
}
5658

57-
external make: React.componentLike<props, (. ~x: string) => React.element> = "default"
59+
external make: React.componentLike<props<string>, React.element> = "default"
5860
}

0 commit comments

Comments
 (0)