Skip to content

Commit 5fef337

Browse files
committed
Only print space when there are props
1 parent e446ae1 commit 5fef337

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/ml/ast_mapper_from0.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ module E = struct
433433
| Pexp_construct ({txt = Longident.Lident "[]" | Longident.Lident "::"}, _)
434434
when has_jsx_attribute () ->
435435
let attrs = attrs |> List.filter (fun ({txt}, _) -> txt <> "JSX") in
436-
(* TODO: support spread *)
437436
jsx_fragment ~loc ~attrs loc.loc_start (map_jsx_children sub e)
438437
loc.loc_end
439438
| Pexp_construct (lid, arg) -> (

compiler/syntax/src/res_printer.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4469,7 +4469,8 @@ and print_jsx_container_tag ~state tag_name props
44694469
print_comments
44704470
(Doc.concat [Doc.less_than; name])
44714471
cmt_tbl tag_name.Asttypes.loc;
4472-
Doc.space;
4472+
(if not (List.is_empty formatted_props) then Doc.space
4473+
else Doc.nil);
44734474
(* todo: might not be needed if no props?*)
44744475
Doc.join formatted_props ~sep:Doc.space;
44754476
(* if tag A has trailing comments then put > on the next line

0 commit comments

Comments
 (0)