Repository navigation
fix: pass null to combined refs on unmount - #358
Merged
Merged
Conversation
useCombinedRefs assigned the forwarded refs from an effect with no cleanup. A callback ref never received null when the element unmounted. react-hook-form uses that null call to stop validating a field. A conditional that hid a required Checkbox group kept blocking submit with no visible error.
JoshTheWanderer
force-pushed
the
fix/checkbox-ref-unmount
branch
from
October 23, 2026 15:51
02554b2 to
8cba5a4
Compare
mergify
Bot
requested review from
a team and
gavmck
and removed request for
a team
October 23, 2026 15:51
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
DanWebb
pushed a commit
that referenced
this pull request
Oct 23, 2026
## <small>9.4.1 (2026-10-23)</small> * Merge pull request #334 from etchteam/mergify/configuration-deprecated-update ([6042157](6042157)), closes [#334](#334) * Merge pull request #353 from etchteam/chore/dependabot-bundle ([2e22eb6](2e22eb6)), closes [#353](#353) * Merge pull request #357 from etchteam/dependabot/npm_and_yarn/follow-redirects-1.16.1 ([8bff529](8bff529)), closes [#357](#357) * Merge pull request #358 from etchteam/fix/checkbox-ref-unmount ([9712883](9712883)), closes [#358](#358) * fix: pass null to combined refs on unmount ([8cba5a4](8cba5a4)) * chore: bump dependabot dependencies ([f95b5ac](f95b5ac)) * chore: bump follow-redirects from 1.16.0 to 1.16.1 ([4802969](4802969)) * chore: keep @svgr/webpack on 5.5.0 ([fc2f63c](fc2f63c)) * chore: restore stylelint typescript peer in lockfile ([391436c](391436c)) * ci(mergify): upgrade configuration to current format ([08a419d](08a419d))
Member
|
🎉 This PR is included in version 9.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
useCombinedRefsassigns the forwarded refs from an effect and never cleans up. A callback ref such as react-hook-form'sregister()never receivesnullwhen the element unmounts. The form keeps validating a field whose inputs are gone.LA Portal hit this bug first. Hiding the HWRC payment options group, a required
Checkboxgroup, left the form unable to submit with no error on screen. AnyCheckboxrendered behind a conditional can hit this. Only components that useuseCombinedRefsare affected.The effect now returns a cleanup that assigns
nullto each ref.