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

Console.error logged when running component from inside react-test-renderer #131

Open
scottdickerson opened this issue Sep 19, 2018 · 1 comment

Comments

@scottdickerson
Copy link

To reproduce, add the react-visibility-sensor to a component then test that component from inside react-test-render and you'll see this console error in the log.

React version 16.4.2
VisibilitySensor version: 4.1

 Invariant Violation: Unable to find node on an unmounted component.
      
      at invariant (node_modules/fbjs/lib/invariant.js:42:15)
      at findCurrentFiberUsingSlowPath (node_modules/react-dom/cjs/react-dom.development.js:3779:30)
      at findCurrentHostFiber (node_modules/react-dom/cjs/react-dom.development.js:3887:23)
      at findHostInstance (node_modules/react-dom/cjs/react-dom.development.js:16825:19)
      at Object.findDOMNode (node_modules/react-dom/cjs/react-dom.development.js:17311:12)
      at Object.componentDidMount (node_modules/react-visibility-sensor/visibility-sensor.js:109:26)
      at Object.chainedFunction [as componentDidMount] (node_modules/create-react-class/factory.js:665:11)
      at commitLifeCycles (node_modules/react-cosmos-telescope/node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7019:22)

Here's a snippet of my component code:

      scrollCheck={true}
      partialVisibility={true}
      resizeCheck={true}
      key={`${name}tile`}>
      {({ isVisible }) => (
        <Tile>

See this underlying issue in React for more information:
facebook/react#7371

@ddennis
Copy link

ddennis commented Aug 4, 2019

did you find a way to fix this?

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

2 participants