Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

fix(Tooltip): Prevent unnecessary setState calls #2424

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

grommett
Copy link

@grommett grommett commented Dec 6, 2019

This PR prevents the handleClickOutside from calling setState if the ToolTip is already closed.

The reason for this check is that, at scale, these calls create real performance issues.

Our app has over 1,000 <Tooltip>s. Each of these Tooltips calls setState({open: false}). These unnecessary calls to setState makes toggling radio buttons and opening Modals very, very slow. Up to two seconds in some cases in our UI. After adding this check the UI behaves normally.

Performance screenshot below.

Screen Shot 2019-12-06 at 11 02 21 AM

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 - Thanks @grommett!

@stale
Copy link

stale bot commented Dec 25, 2019

We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@stale stale bot added the inactive label Dec 25, 2019
@asudoh asudoh removed the inactive label Dec 26, 2019
@stale
Copy link

stale bot commented Jan 8, 2020

We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@stale stale bot added the inactive label Jan 8, 2020
@asudoh asudoh removed the inactive label Jan 8, 2020
@stale
Copy link

stale bot commented Jan 22, 2020

We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@stale stale bot added the inactive label Jan 22, 2020
Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

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

Successfully merging this pull request may close these issues.

3 participants