The library for web and native user interfaces.
Remove autobinding warning
I think this warns on many legitimate use cases. We should get rid of it I think.
Pete Hunt committed
Jul 2, 2013 at 16:52 UTC
8b9891aa8ab2aa2276a21bed2885100f9fbcac50
1 file changed
-16
src/core/ReactCompositeComponent.js
-16
@@ -28,19 +28,6 @@ var keyMirror = require('keyMirror');
28
var merge = require('merge');
29
var mixInto = require('mixInto');
30
31
-function invokeWithWarning(func) {
32
- return function() {
33
- console && console.warn && console.warn(
34
- 'You have invoked a method that is automatically bound, before the ' +
35
- 'instance has been mounted. There is nothing conceptually wrong with ' +
36
- 'this, but since this method will be replaced with a new version once' +
37
- ' the component is mounted - you should be aware of the fact that ' +
38
- 'this method will soon be replaced.'
39
- );
40
- return func.apply(this, arguments);
41
- };
42
-}
43
-
31
/**
32
* Policies that describe methods in `ReactCompositeComponentInterface`.
33
*/
@@ -373,9 +360,6 @@ function mixSpecIntoComponent(Constructor, spec) {
360
}
361
proto.__reactAutoBindMap[name] = property;
362
proto[name] = property;
376
- if (__DEV__) {
377
- proto[name] = invokeWithWarning(property);
378
- }
363
} else {
364
if (isInherited) {
365
// For methods which are defined more than once, call the existing