@@ -378,6 +378,9 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
378378 let keyProp =
379379 args |> List. filter (fun (arg_label , _ ) -> " key" = getLabel arg_label)
380380 in
381+ let makeID =
382+ Exp. ident ~loc: callExprLoc {txt = ident ~suffix: " make" ; loc = callExprLoc}
383+ in
381384 match config.mode with
382385 (* The new jsx transform *)
383386 | "automatic" ->
@@ -397,12 +400,7 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
397400 ( Exp. ident {loc = Location. none; txt = Ldot (Lident " React" , " jsxs" )},
398401 [] )
399402 in
400- Exp. apply ~attrs jsxExpr
401- ([
402- (nolabel, Exp. ident {txt = ident ~suffix: " make" ; loc = callExprLoc});
403- (nolabel, props);
404- ]
405- @ key)
403+ Exp. apply ~attrs jsxExpr ([(nolabel, makeID); (nolabel, props)] @ key)
406404 | _ -> (
407405 match (! childrenArg, keyProp) with
408406 | None , (_ , keyExpr ) :: _ ->
@@ -412,19 +410,12 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
412410 loc = Location. none;
413411 txt = Ldot (Lident " React" , " createElementWithKey" );
414412 })
415- [
416- (nolabel, Exp. ident {txt = ident ~suffix: " make" ; loc = callExprLoc});
417- (nolabel, props);
418- (nolabel, keyExpr);
419- ]
413+ [(nolabel, makeID); (nolabel, props); (nolabel, keyExpr)]
420414 | None , [] ->
421415 Exp. apply ~attrs
422416 (Exp. ident
423417 {loc = Location. none; txt = Ldot (Lident " React" , " createElement" )})
424- [
425- (nolabel, Exp. ident {txt = ident ~suffix: " make" ; loc = callExprLoc});
426- (nolabel, props);
427- ]
418+ [(nolabel, makeID); (nolabel, props)]
428419 | Some children , (_ , keyExpr ) :: _ ->
429420 Exp. apply ~attrs
430421 (Exp. ident
@@ -433,7 +424,7 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
433424 txt = Ldot (Lident " React" , " createElementVariadicWithKey" );
434425 })
435426 [
436- (nolabel, Exp. ident {txt = ident ~suffix: " make " ; loc = callExprLoc} );
427+ (nolabel, makeID );
437428 (nolabel, props);
438429 (nolabel, children);
439430 (nolabel, keyExpr);
@@ -445,11 +436,7 @@ let transformUppercaseCall3 ~config modulePath mapper jsxExprLoc callExprLoc
445436 loc = Location. none;
446437 txt = Ldot (Lident " React" , " createElementVariadic" );
447438 })
448- [
449- (nolabel, Exp. ident {txt = ident ~suffix: " make" ; loc = callExprLoc});
450- (nolabel, props);
451- (nolabel, children);
452- ])
439+ [(nolabel, makeID); (nolabel, props); (nolabel, children)])
453440
454441let transformLowercaseCall3 ~config mapper jsxExprLoc callExprLoc attrs
455442 callArguments id =
0 commit comments