diff --git a/src/dom/DOMPropertyOperations.js b/src/dom/DOMPropertyOperations.js index e4673e119f..9dcc2e2471 100644 --- a/src/dom/DOMPropertyOperations.js +++ b/src/dom/DOMPropertyOperations.js @@ -44,17 +44,20 @@ if (__DEV__) { } warnedProperties[name] = true; - var message = 'Unknown DOM property ' + name + '.'; var lowerCasedName = name.toLowerCase(); // data-* attributes should be lowercase; suggest the lowercase version var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName[lowerCasedName]; + + // For now, only warn when we have a suggested correction. This prevents + // logging too much when using transferPropsTo. if (standardName != null) { - message += ' Did you mean ' + standardName + '?'; + console.warn( + 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?' + ); } - console.warn(message); }; } diff --git a/src/dom/__tests__/DOMPropertyOperations-test.js b/src/dom/__tests__/DOMPropertyOperations-test.js index ec28cfa970..6382a69c5b 100644 --- a/src/dom/__tests__/DOMPropertyOperations-test.js +++ b/src/dom/__tests__/DOMPropertyOperations-test.js @@ -151,24 +151,18 @@ describe('DOMPropertyOperations', function() { describe('injectDOMPropertyConfig', function() { it('should support custom attributes', function() { - spyOn(console, 'warn'); - // foobar does not exist yet expect(DOMPropertyOperations.createMarkupForProperty( 'foobar', 'simple' )).toBe(null); - expect(console.warn.argsForCall.length).toBe(1); - // foo-* does not exist yet expect(DOMPropertyOperations.createMarkupForProperty( 'foo-xyz', 'simple' )).toBe(null); - expect(console.warn.argsForCall.length).toBe(2); - // inject foobar DOM property DOMProperty.injection.injectDOMPropertyConfig({ isCustomAttribute: function(name) {