-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Bug: didPutListener tries to findDOMNode on unmounted component #7440
Comments
For the record, here is the version with React 15: https://jsfiddle.net/7s6mwccu/3/ It is better to describe the error from 15’s point of view because @spicyj fixed a very similar bug in #6650 so exact cause might have changed since then. |
Likely because there is some special logic related to it that always puts it on the specific node (and not the document root).
Likely because |
Do you want to dig into this? |
@gaearon I'm not sure I have the context or bandwidth to look into this. :( We have a temporary workaround in place (defer some work to the next stack frame), but I thought I'd report it in so that someone with more experience could help out. |
I was hoping to get my feet wet with contributing to React, as I have some free time. All the "good first bug" issues seem to be scooped up; think this one is sane to take up? I'll probably have time on Friday to spend some time with it. If anyone else picks it up beforehand, I understand! |
@quicksnap I'm not sure I'd classify this as a "good first bug", but feel free to give it a shot! Never hurts to have more eyes on an issue 😄 |
It looks like this is fixed in 15.4.0-rc.4: I think this is because of my work here (at least But I'm not sure specifically why. I only set up a conditional that won't attach click listeners for buttons. So I made a version that just uses divs: https://jsfiddle.net/7s6mwccu/6/ Works too, though I'm not clear why. |
Updated my comment, interpreted the history wrong on the comparison feature. I think this one might be resolved. |
I believe this is a bug and potentially related to #3298, but the specific details are different enough that I wanted to file a separate issue. Feel free to close if it's the same root cause.
I have a repro here: https://jsfiddle.net/7s6mwccu/2/
causeError
on clickcauseError
first renders components of type A and B (let's call them A0 and B0)causeError
then updates A0 with a new propcauseError
is all done, React's runtime performs some ops (presumably due to B0's setState) that leads to:Peeking at the stacktrace, it looks like
didPutListener
is trying to findDOMNode on an already-unmounted component.Some weird details:
So it's a bit different from #3298 because it's not erroring if we only unmount B during a click; it's erroring if we have onClick and setState.
This is on React 0.14 - I tested it briefly on React 15 and got
which presumably is a better formed version of the same error.
The text was updated successfully, but these errors were encountered: