-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[TS Migration] migrate PopoverWithoutOverlay.js to TypeScript #32171
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
Merged
mountiny
merged 13 commits into
Expensify:main
from
JKobrynski:migratePopoverWithoutOverlayToTypeScript
Dec 27, 2023
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a763f00
migrate PopoverWithoutOverlay.js to TypeScript
JKobrynski e1afa7c
fix type error in BaseModal
JKobrynski cd4167d
import hooks from react
JKobrynski c5a6418
make anchorRef a required prop, conditional onOpen call
JKobrynski eb67796
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
JKobrynski 37e25e6
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
JKobrynski 1902913
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
JKobrynski e930f45
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
JKobrynski 8c62fe2
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
JKobrynski a9b2af2
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
JKobrynski 5c0950d
apply suggested change
JKobrynski 3aaecb1
Merge branch 'main' into migratePopoverWithoutOverlayToTypeScript
VickyStash 030d6b3
Remove extra dot in the comment
VickyStash 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import {View} from 'react-native'; | ||
| import BaseModalProps from '@components/Modal/types'; | ||
| import ChildrenProps from '@src/types/utils/ChildrenProps'; | ||
|
|
||
| type PopoverWithoutOverlayProps = ChildrenProps & | ||
| Omit<BaseModalProps, 'type' | 'popoverAnchorPosition'> & { | ||
| /** The anchor position of the popover */ | ||
| anchorPosition?: { | ||
| top?: number; | ||
| right?: number; | ||
| bottom?: number; | ||
| left?: number; | ||
| }; | ||
|
|
||
| /** The anchor ref of the popover */ | ||
| anchorRef: React.RefObject<HTMLElement>; | ||
|
|
||
| /** A react-native-animatable animation timing for the modal display animation */ | ||
| animationInTiming?: number; | ||
|
|
||
| /** Whether disable the animations */ | ||
| disableAnimation?: boolean; | ||
|
|
||
| /** The ref of the popover */ | ||
| withoutOverlayRef: React.RefObject<HTMLElement & View>; | ||
| }; | ||
|
|
||
| export default PopoverWithoutOverlayProps; | ||
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.
Any issue with this suggestion?
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.
@situchan I've found only one
PopoverWithoutOverlaycomponent usage and it's not optional. If we get rid ofViewinwithoutOverlayReftyping we will have TS issue since this ref is then passed to the View. What do you think?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.
ok and what about
& Viewpart?No issue itself but just asking because it's inconsistent with other ref typings
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.
@situchan As I mentioned, if we get rid of
& Viewpart we will have TS issue in the place where we passwithoutOverlayRefto the View ref.We also have similar cases in the code: one, two
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.
ok no problem