Skip to content

Commit

Permalink
Remove autobinding warning
Browse files Browse the repository at this point in the history
I think this warns on many legitimate use cases. We should get rid of it I think.
  • Loading branch information
petehunt authored and zpao committed Jul 2, 2013
1 parent 9ca7c96 commit 8b9891a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/core/ReactCompositeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ var keyMirror = require('keyMirror');
var merge = require('merge');
var mixInto = require('mixInto');

function invokeWithWarning(func) {
return function() {
console && console.warn && console.warn(
'You have invoked a method that is automatically bound, before the ' +
'instance has been mounted. There is nothing conceptually wrong with ' +
'this, but since this method will be replaced with a new version once' +
' the component is mounted - you should be aware of the fact that ' +
'this method will soon be replaced.'
);
return func.apply(this, arguments);
};
}

/**
* Policies that describe methods in `ReactCompositeComponentInterface`.
*/
Expand Down Expand Up @@ -373,9 +360,6 @@ function mixSpecIntoComponent(Constructor, spec) {
}
proto.__reactAutoBindMap[name] = property;
proto[name] = property;
if (__DEV__) {
proto[name] = invokeWithWarning(property);
}
} else {
if (isInherited) {
// For methods which are defined more than once, call the existing
Expand Down

0 comments on commit 8b9891a

Please sign in to comment.