-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[No QA] [TS Migration] migrate withNavigation.js to TypeScript #29531
[No QA] [TS Migration] migrate withNavigation.js to TypeScript #29531
Conversation
src/components/withNavigation.tsx
Outdated
); | ||
} | ||
|
||
WithNavigation.displayName = `withNavigation(${getComponentDisplayName(WrappedComponent as ComponentType)})`; |
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.
@JKobrynski Maybe you can add same update to getComponentDisplayName
to get rid of the type assertion here
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.
Done!
src/components/withNavigation.tsx
Outdated
navigation: NavigationProp<ReactNavigation.RootParamList>; | ||
}; | ||
|
||
export default function withNavigation<TProps extends WithNavigationProps, TRef>(WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>) { |
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.
Add return type for this function
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.
Done!
@robertKozik @ One of you needs to 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] |
heyyy, successfully got a C+! @JKobrynski make sure you link the issue exactly like it says in the template, otherwise the bot won't know what to do (I edited the PR description and tried again here). Thanks! |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid.-.ios.-.web.movMobile Web - Safariandroid.-.ios.-.web.movDesktopdesktop.moviOSios.native.mov |
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.
🚀
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 one's a bit confusing to me so I'm mostly trusting you (and GH Copilot haha), as I'm not well versed in TypeScript. If y'all have five minutes I'd love a description/explanation of how you approached lines 9-11 but I don't think it should hold the migration.
I would love confirmation on the addition of PascalCase to that eslint rule though, before merging!
@@ -116,7 +116,7 @@ module.exports = { | |||
}, | |||
{ | |||
selector: ['parameter', 'method'], | |||
format: ['camelCase'], | |||
format: ['camelCase', 'PascalCase'], |
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.
NAB - why this change?
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 thing, let me explain! So when it comes to lines 9-11 (and typing HOCs in general) we are following guidelines from these two sources:
it's the same approach in all TypeScript HOC PRs, that's something we agreed upon. About PascalCase
, it's necessary because in HOCs components (WrappedComponent
) are passed as function parameters.
Hope that answers your questions, if there is anything else you'd like me to explain let me know!
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.
ooh got it. Cool, that makes sense!
✋ 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/dangrous in version: 1.3.88-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.88-11 🚀
|
@robertKozik You don't need separate payment, right? If not I won't bother assigning a BZ team member to the issue for payment. |
No need, I'm from expert agency |
Details
Fixed Issues
$ #24954
PROPOSAL: N/A
Tests
N/A
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop