-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Change withOnyx to useOnyx in createOnyxContext #65781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change withOnyx to useOnyx in createOnyxContext #65781
Conversation
fabioh8010
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's do some testing around the app to see if everything is working good.
|
I think we should have some test steps here @zirgulis, this change seems innocent but I'm a little concerned about the impact. Could we remove |
2561f69 to
dd3ac7c
Compare
dd3ac7c to
3d6773a
Compare
|
@alitoshmatov Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@roryabraham ready for review |
3d6773a to
3b03278
Compare
|
|
||
| describe('in default mode', () => { | ||
| it('is not rendered when there are no props passed to it', () => { | ||
| it('is rendered with empty state when no reports are available', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't actually check to ensure that it's rendered with an empty state. Only that it's not null. Can we update this test to be more useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roryabraham fixed
roryabraham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, to you @alitoshmatov for testing
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppcontext-android.movAndroid: mWeb Chromecontext-mweb.moviOS: HybridAppcontext-ios.mp4iOS: mWeb Safaricontext-safari.mp4MacOS: Chrome / Safaricontext-web.movMacOS: Desktopcontext-desktop.mov |
alitoshmatov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.1.88-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.88-3 🚀
|




Explanation of Change
Change the deprecated
withOnyxinside createOnyxContext.tsx touseOnyxFixed Issues
$ #62300
Tests
Verify context providers work correctly after refactor:
createOnyxContext(e.g., settings screen, report screen)Test data reactivity and updates:
createOnyxContextTest multiple context consumers:
Test context hook functionality:
createOnyxContextTest initial data loading:
createOnyxContextTest error scenarios:
createOnyxContextOffline tests
Test offline data availability:
createOnyxContextTest data synchronization when going back online:
QA Steps
Test 1: Personal Details Context (usePersonalDetails)
Screens to test:
Steps:
Test 2: Session Context (useSession)
Screens to test:
Steps:
Test 3: Policy Categories/Tags Context
Screens to test:
Steps:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-07-17.at.17.28.32.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2025-07-17.at.16.48.26.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-07-17.at.16.38.54.mov
MacOS: Desktop