From 3ac81d93dc8ba39809fc92f0ca817bd1a0021c4a Mon Sep 17 00:00:00 2001 From: Ivan Babak Date: Sun, 30 Sep 2018 19:07:53 -0700 Subject: [PATCH] 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. --- packages/react-dom/src/__tests__/ReactMount-test.js | 2 +- packages/react-reconciler/src/ReactFiberHydrationWarning.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactMount-test.js b/packages/react-dom/src/__tests__/ReactMount-test.js index c7c6603b9d566..314cfd62e2a92 100644 --- a/packages/react-dom/src/__tests__/ReactMount-test.js +++ b/packages/react-dom/src/__tests__/ReactMount-test.js @@ -552,7 +552,7 @@ describe('ReactMount', () => { div, ), ).toWarnDev( - 'Warning: Extra attributes from the server: data-ssr-extra-prop,data-ssr-extra-prop-2\n' + + 'Warning: Extra attributes from the server: data-ssr-extra-prop, data-ssr-extra-prop-2\n' + ' in div (at **)', ); }); diff --git a/packages/react-reconciler/src/ReactFiberHydrationWarning.js b/packages/react-reconciler/src/ReactFiberHydrationWarning.js index 27c8b461914fc..6bdc02e1fadc7 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationWarning.js +++ b/packages/react-reconciler/src/ReactFiberHydrationWarning.js @@ -665,7 +665,7 @@ function warnForExtraAttributes(attributeNames: Set) { names.push(name); }); // TODO: As we're here in the terminology of universal hydration, should we stop saying 'from the server'? - warning(false, 'Extra attributes from the server: %s', names); + warning(false, 'Extra attributes from the server: %s', names.join(', ')); } function warnForDeletedHydratableInstance(