-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix: Remove withCurrentReportID HOC #54702
Merged
luacmartins
merged 14 commits into
Expensify:main
from
etCoderDysto:remove-withCurrentReportID-usage
Jan 8, 2025
Merged
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0bd8984
remove with withCurrentReportID from ReportScreen
etCoderDysto cf74dcc
remove withCurrentReportID HOC from withCurrentReportID file
etCoderDysto 34508e9
Merge remote-tracking branch 'upstream/main' into remove-withCurrentR…
etCoderDysto 7edd16a
fix lint
etCoderDysto 575a66d
fix typecheck
etCoderDysto a024e36
move CurrentReportIDContextProvider and all other code blocks to useC…
etCoderDysto d248160
use CurrentReportIDContextProvider exported from useCurrentReportID i…
etCoderDysto dc4c422
move named exports at the bottom of the file
etCoderDysto 6408eb7
use CurrentReportIDContextProvider from useCurrentReportID hook
etCoderDysto ba9e6de
remove CurrentReportIDContext from useCurrentReportID named exports s…
etCoderDysto 5d6082f
remove withCurrentReportIDDefaultProps from useCurrentReportID since …
etCoderDysto 952a9c3
CurrentReportIDContextValue from useCurrentReportId
etCoderDysto cca8360
delete withCurrentReportID hoc
etCoderDysto 3a3b5d5
Merge branch 'main' into remove-withCurrentReportID-usage
etCoderDysto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Isn't the idea to just get rid of this whole file? I only see one place using
updateCurrentReportID
, which could also be removed if I'm not mistaken.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.
@luacmartins I don't think we can remove
updateCurrentReportID
. We are usingupdateCurrentReportID
to update thecurrentReportID
when there is a navigation state change. That helps sync the LHN item focused on LHN, and the currently opened report. If we don't do that, when select an item from LHN, the corresponding report will be opened but the LHN item won't be focused. The issue video is can be found at the bottom.App/src/libs/Navigation/NavigationRoot.tsx
Lines 172 to 173 in 04cd7b0
App/src/components/withCurrentReportID.tsx
Lines 28 to 30 in 575a66d
App/src/components/LHNOptionsList/OptionRowLHNData.tsx
Line 36 in 04cd7b0
But, I believe we can move
CurrentReportIDContextProvider
fromwithCurrentReportID.tsx
touseCurrentReportID.tsx
and deletewithCurrentReportID.tsx
file. Should I do that?POC
Screen.Recording.2025-01-03.at.1.49.03.in.the.afternoon.mp4
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.
Yes, I think we'd want to move from the HOC to the hook fully. Let's migrate that code.
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.
Sure! I will do that.