@samitouri / QOS-React-2 / commits / 192727e152

Make .bind(null, ...) work on autobound methods

Fixes #266.

Ben Alpert committed Aug 15, 2013 at 01:24 UTC 192727e152be303cf3102ce89c6559981c9194fc
1 file changed +1 -1
src/core/ReactCompositeComponent.js
+1 -1
@@ -819,7 +819,7 @@ var ReactCompositeComponentMixin = {
819 // User is trying to bind() an autobound method; we effectively will
820 // ignore the value of "this" that the user is trying to use, so
821 // let's warn.
822 - if (newThis !== component) {
822 + if (newThis !== component && newThis !== null) {
823 console.warn(
824 'bind(): React component methods may only be bound to the ' +
825 'component instance. See ' + componentName