File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1105,23 +1105,23 @@ and print_indented_list (f : P.t) (parent_expr_level : int) (cxt : cxt)
11051105and print_jsx cxt ?(spread_props : J.expression option )
11061106 ?(key : J.expression option ) ~(level : int ) f (fnName : string )
11071107 (tag : J.expression ) (fields : (string * J.expression) list ) : cxt =
1108+ let is_fragment =
1109+ match tag.expression_desc with
1110+ | J. Var (J. Qualified ({id = {name = "JsxRuntime" } } , Some "Fragment" )) ->
1111+ true
1112+ | _ -> false
1113+ in
11081114 let print_tag cxt =
11091115 match tag.expression_desc with
11101116 (* "div" or any other primitive tag *)
11111117 | J. Str {txt} ->
11121118 P. string f txt;
11131119 cxt
11141120 (* fragment *)
1115- | J. Var ( J. Qualified ( { id = { name = "JsxRuntime" } } , Some "Fragment" )) -> cxt
1121+ | _ when is_fragment -> cxt
11161122 (* A user defined component or external component *)
11171123 | _ -> expression ~level cxt f tag
11181124 in
1119- let is_fragment =
1120- match tag.expression_desc with
1121- | J. Var (J. Qualified ({id = {name = "JsxRuntime" } } , Some "Fragment" )) ->
1122- true
1123- | _ -> false
1124- in
11251125 let children_opt =
11261126 List. find_map
11271127 (fun (n , e ) ->
You can’t perform that action at this time.
0 commit comments