Skip to content

Commit 3e18aea

Browse files
committed
better name
1 parent fbfc39d commit 3e18aea

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

jscomp/syntax/src/jsx_v4.ml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
499499
match config.Jsx_common.mode with
500500
(* the new jsx transform *)
501501
| "automatic" ->
502-
let domBinding =
502+
let elementBinding =
503503
match moduleAccessName config with
504504
| "React" -> Lident "ReactDOM"
505505
| generic -> Ldot (Lident generic, "DOM")
@@ -525,7 +525,10 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
525525
( labelled "children",
526526
Exp.apply ~attrs:optionalAttrs
527527
(Exp.ident
528-
{txt = Ldot (domBinding, "someElement"); loc = Location.none})
528+
{
529+
txt = Ldot (elementBinding, "someElement");
530+
loc = Location.none;
531+
})
529532
[(Nolabel, children)] );
530533
]
531534
| ListLiteral {pexp_desc = Pexp_array list} when list = [] -> []
@@ -558,15 +561,18 @@ let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
558561
let jsxExpr, keyAndUnit =
559562
match (!childrenArg, keyProp) with
560563
| None, key :: _ ->
561-
( Exp.ident {loc = Location.none; txt = Ldot (domBinding, "jsxKeyed")},
564+
( Exp.ident
565+
{loc = Location.none; txt = Ldot (elementBinding, "jsxKeyed")},
562566
[key; (nolabel, unitExpr ~loc:Location.none)] )
563567
| None, [] ->
564-
(Exp.ident {loc = Location.none; txt = Ldot (domBinding, "jsx")}, [])
568+
(Exp.ident {loc = Location.none; txt = Ldot (elementBinding, "jsx")}, [])
565569
| Some _, key :: _ ->
566-
( Exp.ident {loc = Location.none; txt = Ldot (domBinding, "jsxsKeyed")},
570+
( Exp.ident
571+
{loc = Location.none; txt = Ldot (elementBinding, "jsxsKeyed")},
567572
[key; (nolabel, unitExpr ~loc:Location.none)] )
568573
| Some _, [] ->
569-
(Exp.ident {loc = Location.none; txt = Ldot (domBinding, "jsxs")}, [])
574+
( Exp.ident {loc = Location.none; txt = Ldot (elementBinding, "jsxs")},
575+
[] )
570576
in
571577
Exp.apply ~loc:jsxExprLoc ~attrs jsxExpr
572578
([(nolabel, componentNameExpr); (nolabel, props)] @ keyAndUnit)

0 commit comments

Comments
 (0)