mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #268 from spicyj/bind-null
Make .bind(null, ...) work on autobound methods
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user