diff --git a/src/printer.js b/src/printer.js
index 334dbd384a7d..8eab69eb094d 100644
--- a/src/printer.js
+++ b/src/printer.js
@@ -1975,7 +1975,7 @@ function printJSXElement(path, options, print) {
children.push(
beginBreak ? hardline : "",
- child.value.replace(/^\s+|\s+$/g, ""),
+ child.value.replace(/^\s+|\s+$/g, endBreak ? "" : " "),
endBreak ? hardline : ""
);
} else if (/\n/.test(child.value)) {
diff --git a/tests/prettier/__snapshots__/jsfmt.spec.js.snap b/tests/prettier/__snapshots__/jsfmt.spec.js.snap
index 0240a50f8a82..441a9fcb1625 100644
--- a/tests/prettier/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/prettier/__snapshots__/jsfmt.spec.js.snap
@@ -60,13 +60,24 @@ const comp4 = (
Create wrapping parens and indentall the things.
+ >Create wrapping parens and indent all the things.
);
const comp5 = Keep it on one line.
;
"
`;
+exports[`test jsx-significant-space.js 1`] = `
+"
+ foo bar
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ foo bar
+;
+"
+`;
+
exports[`test jsx-split-attrs.js 1`] = `
"long_closed =
@@ -155,7 +166,7 @@ const render4 = ({ styles }) => (
Create wrapping parens and indentall the things.
+ >Create wrapping parens and indent all the things.
);
const render5 = ({ styles }) => Keep it on one line.
;
diff --git a/tests/prettier/jsx-significant-space.js b/tests/prettier/jsx-significant-space.js
new file mode 100644
index 000000000000..7b80d6ce7504
--- /dev/null
+++ b/tests/prettier/jsx-significant-space.js
@@ -0,0 +1,3 @@
+
+ foo bar
+