-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting bind warning from react after 1.7.0 #344
Comments
I also got this warning when use with more than one modal on same page. |
This can be due to some double |
Tested, works fine, made pull request #348 |
[edit] actually, it need to be confirmed. |
yeah, I don't know how to fix then. bind -> react gives warning |
yeah, this is kinda sad. this mixture of es5/6. componentWillUnmount: function() {
var modal = this;
{...}
// yes, old style closure...
setTimeout(function() { console.log(this, modal); modal.removePortal(); }, 1);
} |
I think that just having |
Fixes the binding of the `removePortal` call in the `setTimeout` callback by capturing a this reference in a variable in the closure scope. Doesn't use `bind` which apparently causes warnings. Fixes reactjs#344, fixes reactjs#348
Fixes the binding of the `removePortal` call in the `setTimeout` callback by capturing a this reference in a variable in the closure scope. Doesn't use `bind` which apparently causes warnings. Fixes reactjs#344, fixes reactjs#348
@claydiffrient @diasbruno @mreishus I just submitted PR #353 which should solve this. |
Since this issue has a fix, I'm closing this issue. Thanks @mreishus and @adjohnson916 for taking care of this one. |
thanks, sorry about the mess, I was just trying to make things easier~ |
Summary:
I'm getting this warning from react in the console:
Warning: bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See Modal
Here is the call where's it happening (look for the arrow in comments on right side)
Steps to reproduce:
I think it happens when I unmount a modal when it's still disappearing.
The text was updated successfully, but these errors were encountered: