mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Cleanup console.* uses
* Stop doing `global.console && ...` * Make sure all uses are behind `__DEV__` checks so they get stripped out
This commit is contained in:
committed by
Paul O’Shannessy
parent
eee3980749
commit
ac84652e50
@@ -902,7 +902,7 @@ var ReactCompositeComponent = {
|
||||
*/
|
||||
autoBind: function(method) {
|
||||
if (__DEV__) {
|
||||
console.warn && console.warn(
|
||||
console.warn(
|
||||
'React.autoBind() is now deprecated. All React component methods ' +
|
||||
'are auto bound by default, so React.autoBind() is a no-op. It ' +
|
||||
'will be removed in the next version of React'
|
||||
|
||||
@@ -320,11 +320,13 @@ var ReactInstanceHandles = {
|
||||
}
|
||||
}
|
||||
|
||||
global.console && console.error && console.error(
|
||||
'Error while invoking `findComponentRoot` with the following ' +
|
||||
'ancestor node:',
|
||||
ancestorNode
|
||||
);
|
||||
if (__DEV__) {
|
||||
console.error(
|
||||
'Error while invoking `findComponentRoot` with the following ' +
|
||||
'ancestor node:',
|
||||
ancestorNode
|
||||
);
|
||||
}
|
||||
invariant(
|
||||
false,
|
||||
'findComponentRoot(..., %s): Unable to find element. This probably ' +
|
||||
|
||||
@@ -53,10 +53,12 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
|
||||
// TODO (yungsters): Remove support for children content in <textarea>.
|
||||
var children = this.props.children;
|
||||
if (children != null) {
|
||||
console.warn(
|
||||
'Use the `defaultValue` or `value` props instead of setting children ' +
|
||||
'on <textarea>.'
|
||||
);
|
||||
if (__DEV__) {
|
||||
console.warn(
|
||||
'Use the `defaultValue` or `value` props instead of setting ' +
|
||||
'children on <textarea>.'
|
||||
);
|
||||
}
|
||||
invariant(
|
||||
defaultValue == null,
|
||||
'If you supply `defaultValue` on a <textarea>, do not pass children.'
|
||||
|
||||
Reference in New Issue
Block a user