Merge pull request #268 from spicyj/bind-null

Make .bind(null, ...) work on autobound methods
This commit is contained in:
Sebastian Markbåge
2013-08-16 12:06:49 -07:00
+1 -1
View File
@@ -819,7 +819,7 @@ var ReactCompositeComponentMixin = {
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component) {
if (newThis !== component && newThis !== null) {
console.warn(
'bind(): React component methods may only be bound to the ' +
'component instance. See ' + componentName