[flow-strict] Flow strict-local in TimePickerAndroid.android.js#22154
[flow-strict] Flow strict-local in TimePickerAndroid.android.js#22154binaryta wants to merge 3 commits intofacebook:masterfrom
Conversation
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Thanks for this PR! :)
But I think we should make a few changes before we land it.
Also, I see that you launched another PR for the iOS version of this component. We should probably pull those changes into this PR and export the shared types into a separate file to avoid duplicating types.
| * A time has been selected. | ||
| */ | ||
| static get timeSetAction() { | ||
| static getTimeSetAction(): string { |
There was a problem hiding this comment.
Instead of changing this getter into a function, which breaks the public API of this component, let's instead turn it into a covariant static property, which makes it read-only:
static +timeSetAction = 'timeSetAction'There was a problem hiding this comment.
@RSNara Thank you for your advice. I've modified this.
| * The dialog has been dismissed. | ||
| */ | ||
| static get dismissedAction() { | ||
| static getDismissedAction(): string { |
There was a problem hiding this comment.
Let's use a covariant static property here as well:
static +dismissedAction = 'dismissedAction';| static getDismissedAction(): string { | ||
| return 'dismissedAction'; | ||
| } | ||
| static dismissedAction = 'dismissedAction'; |
There was a problem hiding this comment.
I think you forgot to make this covariant:
static +dismissedAction: string = 'dismissedAction';You need the + after the static and before dismissedAction.
| static getTimeSetAction(): string { | ||
| return 'timeSetAction'; | ||
| } | ||
| static timeSetAction = 'timeSetAction'; |
There was a problem hiding this comment.
Same here. You forgot to make this covariant:
static +timeSetAction: string = 'timeSetAction';Summary: Related to #22100 . I had this issue before(#22154 & #22172). Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js. - [x] npm run prettier - [x] npm run flow - [x] npm run flow-check-ios - [x] npm run flow-check-android - [x] npm run lint - [x] npm run test - [x] ./scripts/run-android-local-unit-tests.sh [GENERAL][ENHANCEMENT][TimePickerAndroid.android.js] - apply flow strict-local Pull Request resolved: #22188 Reviewed By: TheSavior Differential Revision: D12972356 Pulled By: RSNara fbshipit-source-id: 838604a791dfdc86bacf8b49f6c399920a3f57bc
Summary: Related to facebook#22100 . I had this issue before(facebook#22154 & facebook#22172). Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js. - [x] npm run prettier - [x] npm run flow - [x] npm run flow-check-ios - [x] npm run flow-check-android - [x] npm run lint - [x] npm run test - [x] ./scripts/run-android-local-unit-tests.sh [GENERAL][ENHANCEMENT][TimePickerAndroid.android.js] - apply flow strict-local Pull Request resolved: facebook#22188 Reviewed By: TheSavior Differential Revision: D12972356 Pulled By: RSNara fbshipit-source-id: 838604a791dfdc86bacf8b49f6c399920a3f57bc
Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a4](facebook/react@fc3b6a411 )**: Fix a few typos ([#22154](facebook/react#22154)) //<Bowen>// - **[986d0e6](facebook/react@986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](facebook/react#22140)) //<Andrew Clark>// - **[d54be90](facebook/react@d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](facebook/react#22139)) //<Andrew Clark>// - **[7ed0706](facebook/react@7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](facebook/react#22114)) //<Dan Abramov>// - **[9eb2aaa](facebook/react@9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](facebook/react#22117)) //<Brian Vaughn>// - **[bd25570](facebook/react@bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](facebook/react#22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8
Related to #22100
Turn Flow strict mode on for Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js.
Test Plan:
Changelog:
[GENERAL][ENHANCEMENT][TimePickerAndroid.android.js] - apply flow strict-local