From 8b9891aa8ab2aa2276a21bed2885100f9fbcac50 Mon Sep 17 00:00:00 2001 From: Pete Hunt Date: Tue, 2 Jul 2013 16:52:38 -0700 Subject: [PATCH] Remove autobinding warning I think this warns on many legitimate use cases. We should get rid of it I think. --- src/core/ReactCompositeComponent.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/core/ReactCompositeComponent.js b/src/core/ReactCompositeComponent.js index e7fef2733b428..52fd65e4a2140 100644 --- a/src/core/ReactCompositeComponent.js +++ b/src/core/ReactCompositeComponent.js @@ -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`. */ @@ -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