Skip to content

refactor(settings): Upgrade to React 19#20841

Draft
xlisachan wants to merge 6 commits into
mainfrom
PAY-3633
Draft

refactor(settings): Upgrade to React 19#20841
xlisachan wants to merge 6 commits into
mainfrom
PAY-3633

Conversation

@xlisachan

@xlisachan xlisachan commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Because

  • Commit 1
    • react-hook-form v6 does not support React 19, blocking the planned upgrade
    • v6 is unmaintained and has known issues with formState reactivity

This pull request

  • Commit 1
    • Bumps react-hook-form from ^6.15.8 to ^7.54.0
    • Adds registration prop to InputText/InputPassword for v7's register() API
    • Migrates all 30+ form components from inputRef={register({...})} to registration={register('fieldName', {...})}
    • Updates type interfaces from UseFormMethods to UseFormReturn
    • Moves errors from top-level useForm destructure to formState.errors
    • Fixes InputPhoneNumber to use setValue with shouldDirty/shouldValidate (v7 no longer auto-tracks dirty state via setValue)
    • Updates tests for v7's async formState updates (userEvent over fireEvent, waitFor for formState assertions, VerifiedSessionGuard mock)
  • Commit 2
    • Upgrade React 18 to 19, react-hook-form v6 to v7
  • Commit 3
    • Extract lazy() from test-utils to avoid prod dependency on test helpers

Issue that this pull request solves

Closes: PAY-3633

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.

@xlisachan
xlisachan force-pushed the PAY-3633 branch 13 times, most recently from fd2df0b to 84f960f Compare July 13, 2026 17:48
Because:
- react-hook-form v6 does not support React 19, blocking the planned upgrade
- v6 is unmaintained and has known issues with formState reactivity

This commit:
- Bumps react-hook-form from ^6.15.8 to ^7.54.0
- Adds `registration` prop to InputText/InputPassword for v7's register() API
- Migrates all 30+ form components from inputRef={register({...})} to registration={register('fieldName', {...})}
- Updates type interfaces from UseFormMethods to UseFormReturn
- Moves errors from top-level useForm destructure to formState.errors
- Fixes InputPhoneNumber to use setValue with shouldDirty/shouldValidate (v7 no longer auto-tracks dirty state via setValue)
- Updates tests for v7's async formState updates (userEvent over fireEvent, waitFor for formState assertions, VerifiedSessionGuard mock)
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.

1 participant