diff --git a/src/browser/dom/DOMPropertyOperations.js b/src/browser/dom/DOMPropertyOperations.js
index 43bdf9c663..ae1e39d632 100644
--- a/src/browser/dom/DOMPropertyOperations.js
+++ b/src/browser/dom/DOMPropertyOperations.js
@@ -23,6 +23,7 @@ var DOMProperty = require('DOMProperty');
var escapeTextForBrowser = require('escapeTextForBrowser');
var memoizeStringOnly = require('memoizeStringOnly');
+var warning = require('warning');
function shouldIgnoreValue(name, value) {
return value == null ||
@@ -57,11 +58,10 @@ if (__DEV__) {
// For now, only warn when we have a suggested correction. This prevents
// logging too much when using transferPropsTo.
- if (standardName != null) {
- console.warn(
- 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
- );
- }
+ warning(
+ standardName == null,
+ 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
+ );
};
}
diff --git a/src/browser/dom/components/LinkedValueUtils.js b/src/browser/dom/components/LinkedValueUtils.js
index ba5c0e618d..3136961cc8 100644
--- a/src/browser/dom/components/LinkedValueUtils.js
+++ b/src/browser/dom/components/LinkedValueUtils.js
@@ -22,6 +22,7 @@
var ReactPropTypes = require('ReactPropTypes');
var invariant = require('invariant');
+var warning = require('warning');
var hasReadOnlyValue = {
'button': true,
@@ -84,33 +85,31 @@ var LinkedValueUtils = {
propTypes: {
value: function(props, propName, componentName) {
if (__DEV__) {
- if (props[propName] &&
- !hasReadOnlyValue[props.type] &&
- !props.onChange &&
- !props.readOnly &&
- !props.disabled) {
- console.warn(
- 'You provided a `value` prop to a form field without an ' +
- '`onChange` handler. This will render a read-only field. If ' +
- 'the field should be mutable use `defaultValue`. Otherwise, ' +
- 'set either `onChange` or `readOnly`.'
- );
- }
+ warning(
+ !props[propName] ||
+ hasReadOnlyValue[props.type] ||
+ props.onChange ||
+ props.readOnly ||
+ props.disabled,
+ 'You provided a `value` prop to a form field without an ' +
+ '`onChange` handler. This will render a read-only field. If ' +
+ 'the field should be mutable use `defaultValue`. Otherwise, ' +
+ 'set either `onChange` or `readOnly`.'
+ );
}
},
checked: function(props, propName, componentName) {
if (__DEV__) {
- if (props[propName] &&
- !props.onChange &&
- !props.readOnly &&
- !props.disabled) {
- console.warn(
- 'You provided a `checked` prop to a form field without an ' +
- '`onChange` handler. This will render a read-only field. If ' +
- 'the field should be mutable use `defaultChecked`. Otherwise, ' +
- 'set either `onChange` or `readOnly`.'
- );
- }
+ warning(
+ !props[propName] ||
+ props.onChange ||
+ props.readOnly ||
+ props.disabled,
+ 'You provided a `checked` prop to a form field without an ' +
+ '`onChange` handler. This will render a read-only field. If ' +
+ 'the field should be mutable use `defaultChecked`. Otherwise, ' +
+ 'set either `onChange` or `readOnly`.'
+ );
}
},
onChange: ReactPropTypes.func
diff --git a/src/browser/dom/components/ReactDOMOption.js b/src/browser/dom/components/ReactDOMOption.js
index cf007bf40e..784007b919 100644
--- a/src/browser/dom/components/ReactDOMOption.js
+++ b/src/browser/dom/components/ReactDOMOption.js
@@ -22,6 +22,8 @@ var ReactBrowserComponentMixin = require('ReactBrowserComponentMixin');
var ReactCompositeComponent = require('ReactCompositeComponent');
var ReactDOM = require('ReactDOM');
+var warning = require('warning');
+
// Store a reference to the