Skip to content

Fix for possible race conditions #268

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

Merged
merged 2 commits into from
Apr 23, 2021
Merged

Conversation

corymharper
Copy link
Contributor

This pull request makes the hook more stable by addressing a concern of possible race conditions introduced by the use of useEffect to manage the number of refs returned after mount. It does so by refactoring that behavior into a useMemo that will be reevaluated any time the number of items changes.

@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #268 (b269cba) into master (09208ac) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #268      +/-   ##
==========================================
- Coverage   91.86%   91.76%   -0.10%     
==========================================
  Files           1        1              
  Lines          86       85       -1     
  Branches       24       24              
==========================================
- Hits           79       78       -1     
  Misses          7        7              
Impacted Files Coverage Δ
src/use-dropdown-menu.ts 91.76% <100.00%> (-0.10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09208ac...b269cba. Read the comment docs.

Copy link
Member

@WesCossick WesCossick 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!

@WesCossick WesCossick merged commit d460aac into master Apr 23, 2021
@WesCossick WesCossick deleted the fix-for-possible-race-conditions branch April 23, 2021 18:04
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.

2 participants