@@ -958,6 +958,12 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
958958 |> Ast_uncurried. uncurriedFun ~loc: fullExpression.pexp_loc ~arity: 1
959959 else fullExpression
960960 in
961+ (* making component abstract *)
962+ let fullExpression =
963+ Exp. apply
964+ (Exp. ident (Location. mknoloc @@ Ldot (Lident " React" , " component" )))
965+ [(Nolabel , fullExpression)]
966+ in
961967 let fullExpression =
962968 match fullModuleName with
963969 | "" -> fullExpression
@@ -1122,7 +1128,7 @@ let transformStructureItem ~config item =
11221128 (name, ptyp_attributes, returnValue.ptyp_loc, type_) :: types )
11231129 | _ -> (fullType, types)
11241130 in
1125- let innerType , propTypes = getPropTypes [] pval_type in
1131+ let _ , propTypes = getPropTypes [] pval_type in
11261132 let namedTypeList = List. fold_left argToConcreteType [] propTypes in
11271133 let retPropsType =
11281134 Typ. constr ~loc: pstr_loc
@@ -1142,8 +1148,8 @@ let transformStructureItem ~config item =
11421148 (* can't be an arrow because it will defensively uncurry *)
11431149 let newExternalType =
11441150 Ptyp_constr
1145- ( {loc = pstr_loc; txt = Ldot (Lident " React" , " componentLike " )},
1146- [retPropsType; innerType ] )
1151+ ( {loc = pstr_loc; txt = Ldot (Lident " React" , " component " )},
1152+ [retPropsType] )
11471153 in
11481154 let newStructure =
11491155 {
@@ -1233,7 +1239,7 @@ let transformSignatureItem ~config item =
12331239 (returnValue, (name, attrs, returnValue.ptyp_loc, type_) :: types)
12341240 | _ -> (fullType, types)
12351241 in
1236- let innerType , propTypes = getPropTypes [] pval_type in
1242+ let _ , propTypes = getPropTypes [] pval_type in
12371243 let namedTypeList = List. fold_left argToConcreteType [] propTypes in
12381244 let retPropsType =
12391245 Typ. constr
@@ -1257,8 +1263,8 @@ let transformSignatureItem ~config item =
12571263 (* can't be an arrow because it will defensively uncurry *)
12581264 let newExternalType =
12591265 Ptyp_constr
1260- ( {loc = psig_loc; txt = Ldot (Lident " React" , " componentLike " )},
1261- [retPropsType; innerType ] )
1266+ ( {loc = psig_loc; txt = Ldot (Lident " React" , " component " )},
1267+ [retPropsType] )
12621268 in
12631269 let newStructure =
12641270 {
0 commit comments