Tweak style mutation warning, remove test comment
Cheng Lou committed
Apr 24, 2015 at 15:04 UTC
1df2b6f63809b6ad3fc4aa5b89cb08d4f78191cc
2 files changed
+3
-4
src/browser/ui/ReactDOMComponent.js
+2
-2
@@ -72,8 +72,8 @@ function checkAndWarnForMutatedStyle(style1, style2, component) {
72
warning(
73
false,
74
'`%s` was passed a style object that has previously been mutated. ' +
75
- 'Mutating `style` will be deprecated. Consider cloning it beforehand. ' +
76
- 'Check the `render` %s. Previous style: %s. Mutated style: %s.',
75
+ 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' +
76
+ 'the `render` %s. Previous style: %s. Mutated style: %s.',
77
componentName,
78
owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>',
79
JSON.stringify(style1),
src/browser/ui/__tests__/ReactDOMComponent-test.js
+1
-2
@@ -119,7 +119,7 @@ describe('ReactDOMComponent', function() {
119
expect(console.error.argsForCall.length).toBe(1);
120
expect(console.error.argsForCall[0][0]).toEqual(
121
'Warning: `div` was passed a style object that has previously been ' +
122
- 'mutated. Mutating `style` will be deprecated. Consider cloning it ' +
122
+ 'mutated. Mutating `style` is deprecated. Consider cloning it ' +
123
'beforehand. Check the `render` of `App`. Previous style: ' +
124
'{"border":"1px solid black"}. Mutated style: ' +
125
'{"border":"1px solid black","position":"absolute"}.'
@@ -217,7 +217,6 @@ describe('ReactDOMComponent', function() {
217
expect(stubStyle.color).toEqual('');
218
});
219
220
- // trouble
220
it("should update styles when 'style' changes from null to object", function() {
221
var container = document.createElement('div');
222
var styles = {color: 'red'};