From 1df2b6f63809b6ad3fc4aa5b89cb08d4f78191cc Mon Sep 17 00:00:00 2001 From: Cheng Lou Date: Fri, 24 Apr 2015 15:04:05 -0400 Subject: [PATCH] Tweak style mutation warning, remove test comment --- src/browser/ui/ReactDOMComponent.js | 4 ++-- src/browser/ui/__tests__/ReactDOMComponent-test.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/browser/ui/ReactDOMComponent.js b/src/browser/ui/ReactDOMComponent.js index 40fcf8e396..fbeee7e8fe 100644 --- a/src/browser/ui/ReactDOMComponent.js +++ b/src/browser/ui/ReactDOMComponent.js @@ -72,8 +72,8 @@ function checkAndWarnForMutatedStyle(style1, style2, component) { warning( false, '`%s` was passed a style object that has previously been mutated. ' + - 'Mutating `style` will be deprecated. Consider cloning it beforehand. ' + - 'Check the `render` %s. Previous style: %s. Mutated style: %s.', + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', JSON.stringify(style1), diff --git a/src/browser/ui/__tests__/ReactDOMComponent-test.js b/src/browser/ui/__tests__/ReactDOMComponent-test.js index 961cea166b..34cb86b0b2 100644 --- a/src/browser/ui/__tests__/ReactDOMComponent-test.js +++ b/src/browser/ui/__tests__/ReactDOMComponent-test.js @@ -119,7 +119,7 @@ describe('ReactDOMComponent', function() { expect(console.error.argsForCall.length).toBe(1); expect(console.error.argsForCall[0][0]).toEqual( 'Warning: `div` was passed a style object that has previously been ' + - 'mutated. Mutating `style` will be deprecated. Consider cloning it ' + + 'mutated. Mutating `style` is deprecated. Consider cloning it ' + 'beforehand. Check the `render` of `App`. Previous style: ' + '{"border":"1px solid black"}. Mutated style: ' + '{"border":"1px solid black","position":"absolute"}.' @@ -217,7 +217,6 @@ describe('ReactDOMComponent', function() { expect(stubStyle.color).toEqual(''); }); - // trouble it("should update styles when 'style' changes from null to object", function() { var container = document.createElement('div'); var styles = {color: 'red'};