@@ -499,7 +499,7 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
499
499
match config.Jsx_common. mode with
500
500
(* the new jsx transform *)
501
501
| "automatic" ->
502
- let domBinding =
502
+ let elementBinding =
503
503
match moduleAccessName config with
504
504
| "React" -> Lident " ReactDOM"
505
505
| generic -> Ldot (Lident generic, " DOM" )
@@ -525,7 +525,10 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
525
525
( labelled " children" ,
526
526
Exp. apply ~attrs: optionalAttrs
527
527
(Exp. ident
528
- {txt = Ldot (domBinding, " someElement" ); loc = Location. none})
528
+ {
529
+ txt = Ldot (elementBinding, " someElement" );
530
+ loc = Location. none;
531
+ })
529
532
[(Nolabel , children)] );
530
533
]
531
534
| ListLiteral {pexp_desc = Pexp_array list } when list = [] -> []
@@ -558,15 +561,18 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
558
561
let jsxExpr, keyAndUnit =
559
562
match (! childrenArg, keyProp) with
560
563
| None , key :: _ ->
561
- ( Exp. ident {loc = Location. none; txt = Ldot (domBinding, " jsxKeyed" )},
564
+ ( Exp. ident
565
+ {loc = Location. none; txt = Ldot (elementBinding, " jsxKeyed" )},
562
566
[key; (nolabel, unitExpr ~loc: Location. none)] )
563
567
| None , [] ->
564
- (Exp. ident {loc = Location. none; txt = Ldot (domBinding , " jsx" )}, [] )
568
+ (Exp. ident {loc = Location. none; txt = Ldot (elementBinding , " jsx" )}, [] )
565
569
| Some _ , key :: _ ->
566
- ( Exp. ident {loc = Location. none; txt = Ldot (domBinding, " jsxsKeyed" )},
570
+ ( Exp. ident
571
+ {loc = Location. none; txt = Ldot (elementBinding, " jsxsKeyed" )},
567
572
[key; (nolabel, unitExpr ~loc: Location. none)] )
568
573
| Some _ , [] ->
569
- (Exp. ident {loc = Location. none; txt = Ldot (domBinding, " jsxs" )}, [] )
574
+ ( Exp. ident {loc = Location. none; txt = Ldot (elementBinding, " jsxs" )},
575
+ [] )
570
576
in
571
577
Exp. apply ~loc: jsxExprLoc ~attrs jsxExpr
572
578
([(nolabel, componentNameExpr); (nolabel, props)] @ keyAndUnit)
0 commit comments