question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using `visible` and `interactive` props together throws an error

See original GitHub issue

When I try to use visible for controlling when the popover shows and interactive together throws an error. there seem to be in this part of code


    // The popper element needs to exist on the DOM before its position can be
    // updated as Popper needs to read its dimensions
    if (!parentNode.contains(popper)) {
      parentNode.appendChild(popper);
    }
createTippy.ts:717 Uncaught TypeError: Cannot read property 'contains' of null
    at mount (createTippy.ts:717)
    at Object.show (createTippy.ts:1003)
    at Tippy.js:154
    at commitHookEffectListMount (react-dom.development.js:20573)
    at commitLifeCycles (react-dom.development.js:20634)
    at commitLayoutEffects (react-dom.development.js:23426)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
    at invokeGuardedCallback (react-dom.development.js:4056)
    at commitRootImpl (react-dom.development.js:23151)
    at unstable_runWithPriority (scheduler.development.js:646)
    at runWithPriority$1 (react-dom.development.js:11276)
    at commitRoot (react-dom.development.js:22990)
    at performSyncWorkOnRoot (react-dom.development.js:22329)
    at react-dom.development.js:11327
    at unstable_runWithPriority (scheduler.development.js:646)
    at runWithPriority$1 (react-dom.development.js:11276)
    at flushSyncCallbackQueueImpl (react-dom.development.js:11322)
    at flushSyncCallbackQueue (react-dom.development.js:11309)
    at flushPassiveEffectsImpl (react-dom.development.js:23620)
    at unstable_runWithPriority (scheduler.development.js:646)
    at runWithPriority$1 (react-dom.development.js:11276)
    at flushPassiveEffects (react-dom.development.js:23447)
    at flushDiscreteUpdates (react-dom.development.js:22356)
    at flushDiscreteUpdatesIfNeeded (react-dom.development.js:3768)
    at dispatchDiscreteEvent (react-dom.development.js:5886)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
atomikscommented, Feb 25, 2021

I don’t really know what the issue is but I can say that interactive will append the tippy to the reference’s parentNode. So if that changes somehow, it might break. A suggestion is to use the appendTo prop to append it to a constant element, like the root element of your app (note: implement keyboard focus etc. though).

        appendTo={() => document.querySelector('#root')}
0reactions
joeldarlingcommented, Nov 16, 2020

I’m actually having this same issue. Oddly enough, it works fine in the browser (in Storybook) with no errors, but fails when I run Jest Storyshots. My setup is identical to @sharno, except visible is set to true by default, and then toggled off via a close button:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using `visible` and `interactive` props together throws an error
When I try to use visible for controlling when the popover shows and interactive together throws an error. there seem to be in...
Read more >
How passing props to component works in React
Master how to pass props (properties) to components in React with this useful beginner's guide, including demo code.
Read more >
Error Handling in React 16 – React Blog
As React 16 release is getting closer, we would like to announce a few changes to how React handles JavaScript errors inside components....
Read more >
Common mistakes with React Testing Library - Kent C. Dodds
If get* queries are unsuccessful in finding the element, they'll throw a really helpful error message that shows you the full DOM structure...
Read more >
Layer Class - deck.gl
Under most circumstances, using visible prop to control the visibility of layers ... Used to propagate errors thrown in layers to the deck.gl...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found