@@ -964,6 +964,12 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
964964 |> Ast_uncurried. uncurriedFun ~loc: fullExpression.pexp_loc ~arity: 1
965965 else fullExpression
966966 in
967+ (* making component abstract *)
968+ let fullExpression =
969+ Exp. apply
970+ (Exp. ident (Location. mknoloc @@ Ldot (Lident " React" , " component" )))
971+ [(Nolabel , fullExpression)]
972+ in
967973 let fullExpression =
968974 match fullModuleName with
969975 | "" -> fullExpression
@@ -1146,7 +1152,7 @@ let transformStructureItem ~config item =
11461152 (name, ptyp_attributes, returnValue.ptyp_loc, type_) :: types )
11471153 | _ -> (fullType, types)
11481154 in
1149- let innerType , propTypes = getPropTypes [] pval_type in
1155+ let _ , propTypes = getPropTypes [] pval_type in
11501156 let namedTypeList = List. fold_left argToConcreteType [] propTypes in
11511157 let retPropsType =
11521158 Typ. constr ~loc: pstr_loc
@@ -1166,8 +1172,8 @@ let transformStructureItem ~config item =
11661172 (* can't be an arrow because it will defensively uncurry *)
11671173 let newExternalType =
11681174 Ptyp_constr
1169- ( {loc = pstr_loc; txt = Ldot (Lident " React" , " componentLike " )},
1170- [retPropsType; innerType ] )
1175+ ( {loc = pstr_loc; txt = Ldot (Lident " React" , " component " )},
1176+ [retPropsType] )
11711177 in
11721178 let newStructure =
11731179 {
@@ -1257,7 +1263,7 @@ let transformSignatureItem ~config item =
12571263 (returnValue, (name, attrs, returnValue.ptyp_loc, type_) :: types)
12581264 | _ -> (fullType, types)
12591265 in
1260- let innerType , propTypes = getPropTypes [] pval_type in
1266+ let _ , propTypes = getPropTypes [] pval_type in
12611267 let namedTypeList = List. fold_left argToConcreteType [] propTypes in
12621268 let retPropsType =
12631269 Typ. constr
@@ -1281,8 +1287,8 @@ let transformSignatureItem ~config item =
12811287 (* can't be an arrow because it will defensively uncurry *)
12821288 let newExternalType =
12831289 Ptyp_constr
1284- ( {loc = psig_loc; txt = Ldot (Lident " React" , " componentLike " )},
1285- [retPropsType; innerType ] )
1290+ ( {loc = psig_loc; txt = Ldot (Lident " React" , " component " )},
1291+ [retPropsType] )
12861292 in
12871293 let newStructure =
12881294 {
0 commit comments