You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Country and state reset on the personal bank account address step #105282
On the personal bank account flow's "What's your address?" step, the country can't be changed and the state can't be typed. Both fields snap back to their saved values after every change.
Steps to reproduce
Sign in with an account that has no bank account added.
Go to Settings > Wallet > Add bank account and choose to connect manually.
Enter the routing and account numbers and continue to the "What's your address?" step.
Select a country other than the United States.
Type a value in the "State / Province" field.
Expected result
The selected country and the typed state stay in the form.
Actual result
The country resets to the saved value, and the state field clears after each keystroke.
Cause
AddressStep builds its address object from Onyx on every render and lists that object as a dependency of the effect that syncs form state from Onyx. The object is new on every render, so the effect runs after every render and resets currentCountry and state. Country and state are the only controlled inputs in AddressForm, so they are the only fields that reset.
The PR removed the useMemo around address in AddressStep.tsx. The sync effect still lists address as a dependency. address is now a new object on every render, so the effect resets currentCountry and state after each render.
Details
The effect that lists address in its dependencies existed before that PR. It was safe while useMemo kept address stable. The PR's diff for this file only removed the useMemo wrapper and left the effect unchanged.
Only two commits touch this file. The other one, from July, just moved the file into the AddPersonalBankAccountPage folder.
The PR changed 932 files and was marked [No QA]. Other components where it removed useMemo from an object that an effect still depends on could have the same bug.
Activity
rafecolton commentedon Oct 28, 2026
@MelvinBot where was this regression introduced?
MelvinBot commentedon Oct 28, 2026
The regression came from [No QA] Disallow manual memoization in compiled React code (
Expensify/App#104522). That PR merged on 2026-10-26 in commit6ad3bf6.The PR removed the
useMemoaroundaddressinAddressStep.tsx. The sync effect still listsaddressas a dependency.addressis now a new object on every render, so the effect resetscurrentCountryandstateafter each render.Details
addressin its dependencies existed before that PR. It was safe whileuseMemokeptaddressstable. The PR's diff for this file only removed theuseMemowrapper and left the effect unchanged.AddPersonalBankAccountPagefolder.[No QA]. Other components where it removeduseMemofrom an object that an effect still depends on could have the same bug.view run
rafecolton commentedon Oct 28, 2026
Heads up @roryabraham @mountiny ☝️ Asked about regression tests in #qa
roryabraham commentedon Oct 28, 2026
thanks for finding and reporting it! Consolidating on #105210