Skip to content

feat: support react-hook-form 7.75.0 (isReady + setValues) (#180)#183

Merged
AlemTuzlak merged 1 commit into
mainfrom
fix/rhf-7.75-setvalues
Jun 1, 2026
Merged

feat: support react-hook-form 7.75.0 (isReady + setValues) (#180)#183
AlemTuzlak merged 1 commit into
mainfrom
fix/rhf-7.75-setvalues

Conversation

@AlemTuzlak
Copy link
Copy Markdown
Contributor

@AlemTuzlak AlemTuzlak commented Jun 1, 2026

Fixes #180 — TS errors after upgrading react-hook-form to 7.75.0.

Root cause

RHF 7.75.0 added two members, and remix-hook-form re-implements those interfaces:

  • FormState.isReadyuseRemixForm rebuilds formState with 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 saw Property 'setValues' is missing.

Fix

  • Expose isReady via a lazy getter that proxies methods.formState.isReady (same pattern as the other fields).
  • setValues flows through the spread; building against 7.75 restores it in the generated .d.ts (verified: the return type now includes setValues: UseFormSetValues<…>).
  • Bump react-hook-form to ^7.75.0 in both devDependencies and peerDependencies — the wrapper now targets 7.75's FormState/UseFormReturn.

Tests

  • formState snapshot test now includes isReady.
  • Two render-count assertions updated: RHF 7.75 raised the baseline by 2 (one extra formState notification per validation cycle). Verified independently of this change — the failures reproduce on unmodified main once RHF is bumped to 7.75, so it's upstream behavior. The lazy-getter optimization still holds: unsubscribed 3 vs subscribed-to-isValidating 5.

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 lint is broken repo-wide — ESLint 9 is installed but there's no eslint.config.js (flat config). CI's validate.yaml only 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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/remix-hook-form@183

commit: 056c49a

@AlemTuzlak AlemTuzlak force-pushed the fix/rhf-7.75-setvalues branch from 88b3c24 to 056c49a Compare June 1, 2026 12:42
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
@AlemTuzlak AlemTuzlak changed the title fix: support react-hook-form 7.75.0 (isReady + setValues) (#180) feat: support react-hook-form 7.75.0 (isReady + setValues) (#180) Jun 1, 2026
@AlemTuzlak AlemTuzlak merged commit 8a314ff into main Jun 1, 2026
5 checks passed
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.

TS errors after upgrading react-hook-form to 7.75.0

1 participant