Skip to content

useCombinedRefs running effect on every call. #2852

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 4 commits into from
Dec 25, 2023

Conversation

nitzanyiz
Copy link
Collaborator

Description

When sending more than two refs to the hook it will always create a new array on each call causing the useEffect to run every time. Until now this didn't happen because we didn't pass more than one ref.

Changelog

useCombinedRef - Added handling for receiving more than one ref.

Additional info

None

@nitzanyiz nitzanyiz changed the title Fix/use combined ref multiple refs renders too much useCombinedRefs running effect on every call. Dec 12, 2023
@nitzanyiz nitzanyiz requested a review from ethanshar December 12, 2023 14:42
@nitzanyiz nitzanyiz marked this pull request as ready for review December 12, 2023 14:42
@nitzanyiz nitzanyiz requested review from M-i-k-e-l and removed request for ethanshar December 13, 2023 08:26
@M-i-k-e-l M-i-k-e-l merged commit 74e5ea2 into master Dec 25, 2023
@nitzanyiz nitzanyiz deleted the fix/useCombinedRef_MultipleRefsRendersTooMuch branch December 25, 2023 15:27
@adids1221 adids1221 mentioned this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants