Repository navigation
Conversation
xlisachan
force-pushed
the
PAY-3633
branch
15 times, most recently
from
July 14, 2026 19:52
a508514 to
e3e3899
Compare
xlisachan
force-pushed
the
PAY-3633
branch
7 times, most recently
from
July 23, 2026 20:20
16d61e7 to
97ab9ab
Compare
xlisachan
force-pushed
the
PAY-3633
branch
8 times, most recently
from
July 28, 2026 19:45
b893285 to
507da4b
Compare
xlisachan
marked this pull request as ready for review
July 28, 2026 20:12
xlisachan
marked this pull request as draft
July 28, 2026 20:15
xlisachan
force-pushed
the
PAY-3633
branch
5 times, most recently
from
August 3, 2026 16:43
04e7ef9 to
0ebe539
Compare
xlisachan
marked this pull request as ready for review
August 3, 2026 20:05
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades react-hook-form to v7 in the FxA Settings UI (and adds it to the Admin Panel) to unblock React 19 compatibility and align form components with v7’s register('field') API and formState behaviors.
Changes:
- Bump
react-hook-formfrom^6.15.8to^7.54.0(lock resolves to a newer compatible v7). - Introduce
registrationonInputText/InputPasswordand migrate call sites frominputRef={register(...)}toregistration={register('field', ...)}. - Update form usage patterns (
formState.errors, Proxy subscription patterns,setValue(..., { shouldDirty/shouldValidate })) and adjust tests for v7 async updates/mocking.
Reviewed changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Locks react-hook-form v7 dependency resolution. |
| packages/fxa-settings/package.json | Bumps react-hook-form dependency to ^7.54.0. |
| packages/fxa-admin-panel/package.json | Adds react-hook-form v7 dependency for admin-panel usage. |
| packages/fxa-settings/src/pages/Signup/index.tsx | Moves errors access to formState.errors when passing props down. |
| packages/fxa-settings/src/pages/Signin/SigninPasskeyFallback/index.tsx | Migrates password input to registration={register('password', ...)} and reads errors from formState. |
| packages/fxa-settings/src/pages/Signin/index.tsx | Migrates password input to registration={register('password')}. |
| packages/fxa-settings/src/pages/ResetPassword/ResetPassword/index.tsx | Migrates email input to registration={register('email')}. |
| packages/fxa-settings/src/pages/ResetPassword/CompleteResetPassword/index.tsx | Switches to formState.errors when passing errors down. |
| packages/fxa-settings/src/pages/ResetPassword/AccountRecoveryConfirmKey/index.tsx | Migrates recovery key input to registration={register('recoveryKey', ...)}. |
| packages/fxa-settings/src/pages/PostVerify/SetPassword/index.tsx | Switches to formState.errors when passing errors down. |
| packages/fxa-settings/src/pages/Index/index.tsx | Migrates email input to registration={register('email')}. |
| packages/fxa-settings/src/components/Settings/SubRow/index.tsx | Migrates passkey rename input to registration={register('name', ...)}. |
| packages/fxa-settings/src/components/Settings/PageSecondaryEmailVerify/index.tsx | Adds explicit formState property reads to ensure Proxy subscriptions; migrates verification code input to registration. |
| packages/fxa-settings/src/components/Settings/PageDisplayName/index.tsx | Adds explicit formState property reads to ensure Proxy subscriptions; migrates displayName input to registration. |
| packages/fxa-settings/src/components/Settings/PageDeleteAccount/index.tsx | Updates disabled logic with eager formState reads; migrates password input to registration. |
| packages/fxa-settings/src/components/Settings/PageCreatePassword/index.tsx | Switches to formState.errors when passing errors down. |
| packages/fxa-settings/src/components/Settings/PageChangePassword/index.tsx | Switches to formState.errors when passing errors down. |
| packages/fxa-settings/src/components/Settings/ModalVerifySession/index.tsx | Migrates verification code input to registration. |
| packages/fxa-settings/src/components/Settings/ModalMfaProtected/index.tsx | Migrates confirmation code input to registration. |
| packages/fxa-settings/src/components/Settings/index.test.tsx | Updates/mocks guards to avoid async session calls during tests. |
| packages/fxa-settings/src/components/Settings/FlowRecoveryKeyConfirmPwd/index.tsx | Migrates password input to registration and adds eager formState property read for Proxy subscription. |
| packages/fxa-settings/src/components/RecoveryKeySetupHint/index.tsx | Migrates hint input to registration={register('hint')}. |
| packages/fxa-settings/src/components/InputText/index.tsx | Adds registration prop and integrates RHF v7 register return shape into InputText. |
| packages/fxa-settings/src/components/InputPhoneNumber/index.tsx | Refactors registration to RHF v7 and uses setValue options to maintain dirty/valid state. |
| packages/fxa-settings/src/components/InputPassword/index.tsx | Plumbs through new registration prop to reuse InputText behavior. |
| packages/fxa-settings/src/components/FormVerifyTotp/index.tsx | Updates submit enablement and keeps RHF state in sync when filtering code input. |
| packages/fxa-settings/src/components/FormVerifyCode/index.tsx | Uses formState.errors + setValue for filtered/validated code input flow. |
| packages/fxa-settings/src/components/FormSetupAccount/interfaces.ts | Updates RHF types from v6 to v7 equivalents for prop typing. |
| packages/fxa-settings/src/components/FormPhoneNumber/index.tsx | Adds eager formState read and keeps submit disabled logic stable under v7. |
| packages/fxa-settings/src/components/FormPhoneNumber/index.test.tsx | Adjusts test waiting/assertions for v7’s async state updates. |
| packages/fxa-settings/src/components/FormPasswordWithInlineCriteria/mocks.tsx | Updates mocks to pass errors: formState.errors. |
| packages/fxa-settings/src/components/FormPasswordWithInlineCriteria/index.tsx | Updates RHF types and migrates to registration={register('field')} usage; adds eager formState reads. |
| packages/fxa-settings/src/components/FormPassword/mocks.tsx | Updates mocks to pass errors: formState.errors. |
| packages/fxa-settings/src/components/FormPassword/index.tsx | Updates RHF types, migrates to registration, and uses eager formState reads for Proxy subscription. |
| packages/fxa-settings/src/components/FormChoice/index.tsx | Migrates radio registration to v7 ...register('choice') spread usage. |
| packages/fxa-admin-panel/src/components/PageRateLimiting/index.tsx | Migrates inputs to v7 ...register(id) usage. |
Suppressed comments (1)
packages/fxa-settings/src/components/FormSetupAccount/interfaces.ts:21
errors: Record<string, any>discards react-hook-form’s error typing, making downstream usage easier to get wrong. PreferFieldErrors<FormSetupAccountData>(or another RHF error type) so consumers can rely on the correct structure.
export type FormSetupAccountProps = {
formState: AnyFormReturn['formState'];
errors: Record<string, any>;
trigger: AnyFormReturn['trigger'];
register: AnyFormReturn['register'];
getValues: AnyFormReturn['getValues'];
Comment on lines
+98
to
+101
| // Set initial countryCode value for react-hook-form | ||
| React.useEffect(() => { | ||
| setValue('countryCode', selectedCountry.code); | ||
| }, []); // eslint-disable-line react-hooks/exhaustive-deps |
Contributor
Author
There was a problem hiding this comment.
useEffect was removed entirely. countryCode now lives in react-hook-form state via defaultValues in FormPhoneNumber and kept in sync by setValue in handleCountryChange.
xlisachan
force-pushed
the
PAY-3633
branch
4 times, most recently
from
August 5, 2026 21:02
626459a to
f719832
Compare
vpomerleau
approved these changes
Aug 7, 2026
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.
Because
This pull request
registrationprop to InputText/InputPassword for v7's register() APIIssue that this pull request solves
Closes: PAY-3633
Checklist
Put an
xin the boxes that apply