sparksuite / react-accessible-dropdown-menu-hook

A simple Hook for creating fully accessible dropdown menus in React
http://sparksuite.github.io/react-accessible-dropdown-menu-hook
MIT License
112 stars 26 forks source link

Fix for possible race conditions #268

Closed corymharper closed 3 years ago

corymharper commented 3 years ago

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[bot] commented 3 years ago

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%) :arrow_down:

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.