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

When tooltip on components that are destroyed, causes warning spam. #148

Closed
Tetheta opened this issue Jul 26, 2016 · 14 comments
Closed

When tooltip on components that are destroyed, causes warning spam. #148

Tetheta opened this issue Jul 26, 2016 · 14 comments
Labels

Comments

@Tetheta
Copy link

Tetheta commented Jul 26, 2016

I have two components with tooltips that get generated on each. If I then remove one of the later components, I start getting the following error many times a second when I hover over the remaining tooltip.

"Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the undefined component."

I've traced it to something happening in your showTooltip function, I'm guessing you're iterating over non-existent children somehow?

@wwayne
Copy link
Collaborator

wwayne commented Jul 27, 2016

I don't think it will iterate non-existent children, can you share me some of your code so that I can get a better view, because I'm not that clear what you mean "get generated on each"

@meandavejustice
Copy link
Contributor

I am also having this issue. I think it may be related to using data-tip=value, when I use data-tip-for and the <ReactTooltip> element for each instance I do not receive the error.

relevant jsx:

<div className='left'>
  <ReactTooltip place='bottom' effect='solid' />
   <a onClick={this.play} data-tip='Play'
         className={this.props.playing ? 'play hidden' : 'play'} />
   <a onClick={this.pause} data-tip='Pause'
         className={this.props.playing ? 'pause' : 'pause hidden'} />
    <a onClick={this.mute} data-tip='Mute'
         className={cn('mute', {hidden: this.props.muted})} />
    <a onClick={this.unmute} data-tip='Unmute'
         className={cn('unmute', {hidden: !this.props.muted})} />
    <input type='range' className={cn('volume', {hidden: !this.props.showVolume})}
               min='0' max='1' step='.01' value={this.props.volume}
                onChange={this.setVolume}/>
</div>

@wwayne
Copy link
Collaborator

wwayne commented Jul 30, 2016

Could be, the ReactTooltip will bind event when componentDidMount, so if you leave the ReactTooltip and delete one of the target element, it will cause setState error when showTooltip. you can use for and id, also you can use ReactTooltip.rebuild() to rebind target elements after they update.

@wwayne wwayne closed this as completed Jul 30, 2016
@meandavejustice
Copy link
Contributor

@wwayne I'm wondering if this issue may be deeper as in my example above I'm not deleting a target element, only changing the style to display:none; when not hovering over it's parent.

@wwayne
Copy link
Collaborator

wwayne commented Aug 19, 2016

I'm think if this way is better #137, but you have to hide the element as well.

is it useful if there is an attribute disabled for controlling the tooltip?

@Shion093
Copy link

Shion093 commented Jan 2, 2017

having same problem over mapped element

@ImmRanneft
Copy link

@wwayne having same issue with react-dnd. ReactTooltip.rebuild() doesn't work.

@vbbartlett
Copy link

vbbartlett commented Mar 27, 2017

@wwayne I also am having a problem with react-dnd and tooltips. I don't have warnings, rather chrome simply crashes. I found a mention in the dnd that it has problems with children having absolute coords.
See the link: react-dnd/react-dnd#419

Looking for any suggestions how to fix this.

More info: I have a dnd component and IF I hover (I have a delay tooltip) and the toolitp displays the component drags fine, however if I DON'T show the tooltip first, it crashes the dnd component

@huumanoid huumanoid reopened this Mar 27, 2017
@ImmRanneft
Copy link

@vbbartlett just use one tooltip otside component wrapped with DragDropContext.
I managed to save tooltips for my drag sources.

@brunzero
Copy link

brunzero commented Aug 7, 2017

@vbbartlett I'm having the same issue and I also noticed that if I hover the component drags fine. Have you been able to find any solutions to this issue?

@vbbartlett
Copy link

@brunzero, No I haven't been able to solve the issue. Ended up removing the tooltips. :(

@forrestbice
Copy link

Any progress on this issue? @pelhage and I are still experiencing this issue; really hoping we don't need to fully remove the tooltip...

@flccrakers
Copy link

Hey I also have this issue. It didn't prevent my app to work but send annoying error code. Beside, it show me two tooltip when this is happening.
capture du 2018-01-11 17-48-57

@danielbarion
Copy link
Member

Hi guys, closing due to age, we did some publishes recently, please try the latest one and if necessary, open a new issue, thanks!

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

No branches or pull requests