File tree 2 files changed +12
-18
lines changed
2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,14 @@ let add_async_attribute ~async (body : Parsetree.expression) =
77
77
let is_async : Parsetree.attribute -> bool =
78
78
fun ({txt} , _ ) -> txt = " async" || txt = " res.async"
79
79
80
- let async_component expr =
81
- let open Ast_helper in
82
- Exp. apply
83
- (Exp. ident
84
- {
85
- loc = Location. none;
86
- txt = Ldot (Lident " JsxPPXReactSupport" , " asyncComponent" );
87
- })
88
- [(Nolabel , expr)]
80
+ let async_component ~async expr =
81
+ if async then
82
+ let open Ast_helper in
83
+ Exp. apply
84
+ (Exp. ident
85
+ {
86
+ loc = Location. none;
87
+ txt = Ldot (Lident " JsxPPXReactSupport" , " asyncComponent" );
88
+ })
89
+ [(Nolabel , expr)]
90
+ else expr
Original file line number Diff line number Diff line change @@ -970,15 +970,7 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
970
970
else fullExpression
971
971
in
972
972
let fullExpression =
973
- if isAsync then
974
- Exp. apply
975
- (Exp. ident
976
- {
977
- loc = Location. none;
978
- txt = Ldot (Lident " JsxPPXReactSupport" , " asyncComponent" );
979
- })
980
- [(Nolabel , fullExpression)]
981
- else fullExpression
973
+ React_jsx_common. async_component ~async: isAsync fullExpression
982
974
in
983
975
let fullExpression =
984
976
match fullModuleName with
You can’t perform that action at this time.
0 commit comments