@@ -977,6 +977,12 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
977977 innerExpression
978978 else innerExpression)
979979 in
980+ (* making component abstract *)
981+ let fullExpression =
982+ Exp. apply
983+ (Exp. ident (Location. mknoloc @@ Ldot (Lident " React" , " component" )))
984+ [(Nolabel , fullExpression)]
985+ in
980986 let fullExpression =
981987 if ! Config. uncurried = Uncurried then
982988 fullExpression
@@ -1174,7 +1180,7 @@ let transformStructureItem ~config item =
11741180 (name, ptyp_attributes, returnValue.ptyp_loc, type_) :: types )
11751181 | _ -> (fullType, types)
11761182 in
1177- let innerType , propTypes = getPropTypes [] pval_type in
1183+ let _innerType , propTypes = getPropTypes [] pval_type in
11781184 let namedTypeList = List. fold_left argToConcreteType [] propTypes in
11791185 let retPropsType =
11801186 Typ. constr ~loc: pstr_loc
@@ -1194,8 +1200,8 @@ let transformStructureItem ~config item =
11941200 (* can't be an arrow because it will defensively uncurry *)
11951201 let newExternalType =
11961202 Ptyp_constr
1197- ( {loc = pstr_loc; txt = moduleAccessName config " componentLike " },
1198- [retPropsType; innerType ] )
1203+ ( {loc = pstr_loc; txt = moduleAccessName config " component " },
1204+ [retPropsType] )
11991205 in
12001206 let newStructure =
12011207 {
@@ -1282,7 +1288,7 @@ let transformSignatureItem ~config item =
12821288 (returnValue, (name, attrs, returnValue.ptyp_loc, type_) :: types)
12831289 | _ -> (fullType, types)
12841290 in
1285- let innerType , propTypes = getPropTypes [] pval_type in
1291+ let _innerType , propTypes = getPropTypes [] pval_type in
12861292 let namedTypeList = List. fold_left argToConcreteType [] propTypes in
12871293 let retPropsType =
12881294 Typ. constr
@@ -1301,8 +1307,8 @@ let transformSignatureItem ~config item =
13011307 (* can't be an arrow because it will defensively uncurry *)
13021308 let newExternalType =
13031309 Ptyp_constr
1304- ( {loc = psig_loc; txt = moduleAccessName config " componentLike " },
1305- [retPropsType; innerType ] )
1310+ ( {loc = psig_loc; txt = moduleAccessName config " component " },
1311+ [retPropsType] )
13061312 in
13071313 let newStructure =
13081314 {
0 commit comments