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

Call setProps only if Tooltip component is not mounted #1011

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

tcbegley
Copy link
Collaborator

Previously we were getting errors due to uncancelled timers not getting cleaned up properly when the component unmounted. This resulted in a delayed call to setProps and an error.

Unfortunately cancelling the timeouts directly appears to be challenging, so this change introduces a simple isMountedRef which is used a guard on calls to setProps.

cf. #997

Previously we were getting errors due to uncancelled timers not getting
cleaned up properly when the component unmounted. This resulted in a
delayed call to setProps and an error.

Unfortunately cancelling the timeouts directly appears to be
challenging, so this change introduces a simple `isMountedRef` which is
used a guard on calls to setProps.
@tcbegley tcbegley merged commit 4e294c1 into main Apr 14, 2024
14 checks passed
@tcbegley tcbegley deleted the tooltip-race-condition branch April 14, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant