Tweak style mutation warning, remove test comment

This commit is contained in:
Cheng Lou
2015-04-24 15:04:05 -04:00
parent 288c7ed139
commit 1df2b6f638
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -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),
@@ -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'};