@@ -24,7 +24,6 @@ var assign = require('Object.assign');
2424var invariant = require ( 'invariant' ) ;
2525var keyMirror = require ( 'keyMirror' ) ;
2626var keyOf = require ( 'keyOf' ) ;
27- var monitorCodeUse = require ( 'monitorCodeUse' ) ;
2827var warning = require ( 'warning' ) ;
2928
3029var MIXINS_KEY = keyOf ( { mixins : null } ) ;
@@ -659,17 +658,19 @@ function bindAutoBindMethod(component, method) {
659658 // ignore the value of "this" that the user is trying to use, so
660659 // let's warn.
661660 if ( newThis !== component && newThis !== null ) {
662- monitorCodeUse ( 'react_bind_warning' , { component : componentName } ) ;
663- console . warn (
661+ warning (
662+ false ,
664663 'bind(): React component methods may only be bound to the ' +
665- 'component instance. See ' + componentName
664+ 'component instance. See %s' ,
665+ componentName
666666 ) ;
667667 } else if ( ! args . length ) {
668- monitorCodeUse ( 'react_bind_warning' , { component : componentName } ) ;
669- console . warn (
668+ warning (
669+ false ,
670670 'bind(): You are binding a component method to the component. ' +
671671 'React does this for you automatically in a high-performance ' +
672- 'way, so you can safely remove this call. See ' + componentName
672+ 'way, so you can safely remove this call. See ' ,
673+ componentName
673674 ) ;
674675 return boundMethod ;
675676 }
@@ -874,18 +875,14 @@ var ReactClass = {
874875 ) ;
875876
876877 if ( __DEV__ ) {
877- if ( Constructor . prototype . componentShouldUpdate ) {
878- monitorCodeUse (
879- 'react_component_should_update_warning' ,
880- { component : spec . displayName }
881- ) ;
882- console . warn (
883- ( spec . displayName || 'A component' ) + ' has a method called ' +
884- 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
885- 'The name is phrased as a question because the function is ' +
886- 'expected to return a value.'
887- ) ;
888- }
878+ warning (
879+ ! Constructor . prototype . componentShouldUpdate ,
880+ '%s has a method called ' +
881+ 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
882+ 'The name is phrased as a question because the function is ' +
883+ 'expected to return a value.' ,
884+ spec . displayName || 'A component'
885+ ) ;
889886 }
890887
891888 // Reduce time spent doing lookups by setting these on the prototype.
0 commit comments