@@ -977,6 +977,12 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
977
977
innerExpression
978
978
else innerExpression)
979
979
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
980
986
let fullExpression =
981
987
if ! Config. uncurried = Uncurried then
982
988
fullExpression
@@ -1174,7 +1180,7 @@ let transformStructureItem ~config item =
1174
1180
(name, ptyp_attributes, returnValue.ptyp_loc, type_) :: types )
1175
1181
| _ -> (fullType, types)
1176
1182
in
1177
- let innerType , propTypes = getPropTypes [] pval_type in
1183
+ let _innerType , propTypes = getPropTypes [] pval_type in
1178
1184
let namedTypeList = List. fold_left argToConcreteType [] propTypes in
1179
1185
let retPropsType =
1180
1186
Typ. constr ~loc: pstr_loc
@@ -1194,8 +1200,8 @@ let transformStructureItem ~config item =
1194
1200
(* can't be an arrow because it will defensively uncurry *)
1195
1201
let newExternalType =
1196
1202
Ptyp_constr
1197
- ( {loc = pstr_loc; txt = moduleAccessName config " componentLike " },
1198
- [retPropsType; innerType ] )
1203
+ ( {loc = pstr_loc; txt = moduleAccessName config " component " },
1204
+ [retPropsType] )
1199
1205
in
1200
1206
let newStructure =
1201
1207
{
@@ -1282,7 +1288,7 @@ let transformSignatureItem ~config item =
1282
1288
(returnValue, (name, attrs, returnValue.ptyp_loc, type_) :: types)
1283
1289
| _ -> (fullType, types)
1284
1290
in
1285
- let innerType , propTypes = getPropTypes [] pval_type in
1291
+ let _innerType , propTypes = getPropTypes [] pval_type in
1286
1292
let namedTypeList = List. fold_left argToConcreteType [] propTypes in
1287
1293
let retPropsType =
1288
1294
Typ. constr
@@ -1301,8 +1307,8 @@ let transformSignatureItem ~config item =
1301
1307
(* can't be an arrow because it will defensively uncurry *)
1302
1308
let newExternalType =
1303
1309
Ptyp_constr
1304
- ( {loc = psig_loc; txt = moduleAccessName config " componentLike " },
1305
- [retPropsType; innerType ] )
1310
+ ( {loc = psig_loc; txt = moduleAccessName config " component " },
1311
+ [retPropsType] )
1306
1312
in
1307
1313
let newStructure =
1308
1314
{
0 commit comments