@@ -27,8 +27,7 @@ let getLabel str =
27
27
| Optional str | Labelled str -> str
28
28
| Nolabel -> " "
29
29
30
- let optionalAttr = ({txt = " res.optional" ; loc = Location. none}, PStr [] )
31
- let optionalAttrs = [optionalAttr]
30
+ let optionalAttrs = [React_jsx_common. optionalAttr]
32
31
33
32
let constantString ~loc str =
34
33
Ast_helper.Exp. constant ~loc (Pconst_string (str, None ))
@@ -740,12 +739,7 @@ let transformStructureItem ~config item =
740
739
config.hasReactComponent < - true ;
741
740
check_string_int_attribute_iter.structure_item
742
741
check_string_int_attribute_iter item;
743
- let pval_type =
744
- if Ast_uncurried. typeIsUncurriedFun pval_type then
745
- let _arity, t = Ast_uncurried. typeExtractUncurriedFun pval_type in
746
- t
747
- else pval_type
748
- in
742
+ let pval_type = React_jsx_common. extractUncurried pval_type in
749
743
let coreTypeOfAttr = React_jsx_common. coreTypeOfAttrs pval_attributes in
750
744
let typVarsOfCoreType =
751
745
coreTypeOfAttr
@@ -816,21 +810,7 @@ let transformStructureItem ~config item =
816
810
React_jsx_common. raiseErrorMultipleReactComponent ~loc: pstr_loc
817
811
else (
818
812
config.hasReactComponent < - true ;
819
- let rec removeArityRecord expr =
820
- match expr.pexp_desc with
821
- | _ when Ast_uncurried. exprIsUncurriedFun expr ->
822
- Ast_uncurried. exprExtractUncurriedFun expr
823
- | Pexp_apply (forwardRef , [(label , e )]) ->
824
- {
825
- expr with
826
- pexp_desc =
827
- Pexp_apply (forwardRef, [(label, removeArityRecord e)]);
828
- }
829
- | _ -> expr
830
- in
831
- let binding =
832
- {binding with pvb_expr = removeArityRecord binding.pvb_expr}
833
- in
813
+ let binding = React_jsx_common. removeArity binding in
834
814
let coreTypeOfAttr =
835
815
React_jsx_common. coreTypeOfAttrs binding.pvb_attributes
836
816
in
@@ -1274,12 +1254,7 @@ let transformSignatureItem ~config _mapper item =
1274
1254
if config.React_jsx_common. hasReactComponent then
1275
1255
React_jsx_common. raiseErrorMultipleReactComponent ~loc: psig_loc
1276
1256
else config.hasReactComponent < - true ;
1277
- let pval_type =
1278
- if Ast_uncurried. typeIsUncurriedFun pval_type then
1279
- let _arity, t = Ast_uncurried. typeExtractUncurriedFun pval_type in
1280
- t
1281
- else pval_type
1282
- in
1257
+ let pval_type = React_jsx_common. extractUncurried pval_type in
1283
1258
check_string_int_attribute_iter.signature_item
1284
1259
check_string_int_attribute_iter item;
1285
1260
let hasForwardRef = ref false in
0 commit comments