Skip to content

Commit 3ac81d9

Browse files
committed
ReactFiberHydrationWarning in react-reconciler: pretty attribute names
Print the extra attribute names array nicer, with a space after comma. The default array toString was used implicitly before.
1 parent 3916a3b commit 3ac81d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-dom/src/__tests__/ReactMount-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ describe('ReactMount', () => {
552552
div,
553553
),
554554
).toWarnDev(
555-
'Warning: Extra attributes from the server: data-ssr-extra-prop,data-ssr-extra-prop-2\n' +
555+
'Warning: Extra attributes from the server: data-ssr-extra-prop, data-ssr-extra-prop-2\n' +
556556
' in div (at **)',
557557
);
558558
});

packages/react-reconciler/src/ReactFiberHydrationWarning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ function warnForExtraAttributes(attributeNames: Set<string>) {
665665
names.push(name);
666666
});
667667
// TODO: As we're here in the terminology of universal hydration, should we stop saying 'from the server'?
668-
warning(false, 'Extra attributes from the server: %s', names);
668+
warning(false, 'Extra attributes from the server: %s', names.join(', '));
669669
}
670670

671671
function warnForDeletedHydratableInstance(

0 commit comments

Comments
 (0)