Skip to content
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

findDOMNode was called on an unmounted component #66

Open
vcarel opened this issue Feb 28, 2017 · 3 comments
Open

findDOMNode was called on an unmounted component #66

vcarel opened this issue Feb 28, 2017 · 3 comments

Comments

@vcarel
Copy link

vcarel commented Feb 28, 2017

We're using react-visibilty-sensor to animate pictures on our home page, and we use https://sentry.io to monitor errors on client side.

We've got multiple reports on the following issue: "Invariant Violation: findDOMNode was called on an unmounted component"
This happens in visibility-sensor.js, there:

  /**
   * Check if the element is within the visible viewport
   */
  check: function () {
    var el = ReactDOM.findDOMNode(this);
    var rect;
    var containmentRect;

(on Chrome mobile 56.0.2924)

I can't reproduce on my computer, but looks related to the tabs "Je suis propriétaire / Je suis acquéreur".

What I understand from your code is that at the end there's no real issue, because if you can't find the node you do nothing. But that warning is a bit annoying.

I presume the issue comes from a last check() call by "debounceCheck", because you don't clear the setTimeout l.21 on stopWatching

@joshwnj
Copy link
Owner

joshwnj commented Mar 1, 2017

Thanks for the report @vcarel - I'll have a go at reproducing, I think you're on the right track about the cause.

@eek
Copy link
Collaborator

eek commented Mar 8, 2017

Yup, found the bug as well, will push a fix asap

eek pushed a commit to eek/react-visibility-sensor that referenced this issue Mar 8, 2017
@brandonweis
Copy link

Same issues, May I know when the fix is going to be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants