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.

When Tooltip is used with a child chart, and it receives new props, the child chart never updates

See original GitHub issue

Expected Behavior

The child chart should update when props are swapped

Current Behavior

The child chart does not update

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a chart with the Tooltip parent and a child chart (ex. StackedArea), with a valid data prop
  2. Pass a new valid data prop to the child chart
  3. Notice that child chart does not re-render with new data

Context

The reason this happens is because we are rendering the child chart in Tooltip’s constructor function, which only gets run on instantiation.

Even passing new props directly to the child chart does not seem to help.

We probably need to refactor the way the Tooltip interacts with its child chart.

Your Environment

  • Version used:
  • Browser Name and version:
  • Operating System and version:
  • Link to your project or codepen:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ronvennacommented, May 19, 2018

@DalerAsrorov no problem, thanks for the quick response. Will take a look at this and submit a PR.

0reactions
miglesiasEBcommented, Jul 18, 2019

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

React: why child component doesn't update when prop changes
Depends on what you are trying to achieve. Parent can't poke around child props to change it. parent needs to re-render itself to...
Read more >
visx/tooltip documentation
This package provides two ways to add tooltip state logic to your chart ... To use a Portal , simply pass your Tooltip...
Read more >
Tooltip - Examples - Components - Atlassian Design System
A tooltip is a floating, non-actionable label used to explain a user interface element or feature.
Read more >
jasongaare/react-native-walkthrough-tooltip - GitHub
Changes to handling users pressing the tooltip child element: No more onChildPress and onChildLongPress props - touches are now passed to the child...
Read more >
Controlling tooltips & pop-up menus with components in React
Children with map function to iterate over all the children and return a clone of each child with React.cloneElement . Also, use of...
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