feat: support react-hook-form 7.75.0 (isReady + setValues) (#180)#183
Merged
Conversation
commit: |
88b3c24 to
056c49a
Compare
react-hook-form 7.75.0 added `isReady` to FormState and `setValues` to UseFormReturn, which broke consumers with 'Property setValues/isReady is missing' type errors (#180). - Expose `isReady` on the wrapped formState via a lazy getter (matching the existing pattern that proxies methods.formState). - `setValues` already flows through the `...methods` spread; rebuilding against 7.75 restores it in the published types. - Bump react-hook-form to ^7.75.0 in both devDependencies and peerDependencies (the wrapper now targets 7.75's FormState/UseFormReturn). - Update the formState snapshot test to include isReady, and the two render-count assertions: 7.75 raised the baseline by 2 (an extra formState notification per validation cycle); the lazy-getter optimization still holds (unsubscribed 3 vs subscribed 5). Fixes #180
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.
Fixes #180 — TS errors after upgrading
react-hook-formto 7.75.0.Root cause
RHF 7.75.0 added two members, and
remix-hook-formre-implements those interfaces:FormState.isReady—useRemixFormrebuildsformStatewith lazy getters (to preserve RHF's render optimization), so it was missing the new field →Property 'isReady' is missing in type … FormState.UseFormReturn.setValues— present at runtime via...methods, but the published 7.1.1 types were built pre-7.75 and didn't include it → consumers on 7.75 sawProperty 'setValues' is missing.Fix
isReadyvia a lazy getter that proxiesmethods.formState.isReady(same pattern as the other fields).setValuesflows through the spread; building against 7.75 restores it in the generated.d.ts(verified: the return type now includessetValues: UseFormSetValues<…>).react-hook-formto^7.75.0in bothdevDependenciesandpeerDependencies— the wrapper now targets 7.75'sFormState/UseFormReturn.Tests
formStatesnapshot test now includesisReady.formStatenotification per validation cycle). Verified independently of this change — the failures reproduce on unmodifiedmainonce RHF is bumped to 7.75, so it's upstream behavior. The lazy-getter optimization still holds: unsubscribed3vs subscribed-to-isValidating5.Typecheck ✓, all 48 tests ✓, build ✓ against
react-hook-form@7.75.0.Release
Ships as a minor (changeset included). Once merged, the Release PR bumps 7.1.1 → 7.2.0 and publishes with provenance.
Note (out of scope)
npm run lintis broken repo-wide — ESLint 9 is installed but there's noeslint.config.js(flat config). CI'svalidate.yamlonly runs typecheck + vitest (the lint job is commented out), so this doesn't block, but it's worth a separate fix.🤖 Generated with Claude Code