Repository navigation
40211 handle conflict mapview event on android #41603
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
neil-marcellini
merged 3 commits into
Expensify:main
from
suneox:40211-mapview-conflict-event-on-android
May 7, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import DraggableFlatList from 'react-native-draggable-flatlist'; | ||
| import type {FlatList} from 'react-native-gesture-handler'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import type {DraggableListProps} from './types'; | ||
|
|
||
| function DraggableList<T>({renderClone, shouldUsePortal, ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<FlatList<T>>) { | ||
| const styles = useThemeStyles(); | ||
| return ( | ||
| <View style={styles.flex1}> | ||
| <DraggableFlatList | ||
| ref={ref} | ||
| containerStyle={ListFooterComponent ? undefined : styles.flex1} | ||
| contentContainerStyle={ListFooterComponent ? undefined : styles.flexGrow1} | ||
| // eslint-disable-next-line react/jsx-props-no-spreading | ||
| {...viewProps} | ||
| /> | ||
| {React.isValidElement(ListFooterComponent) && <View style={styles.flexGrow1}>{ListFooterComponent}</View>} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| DraggableList.displayName = 'DraggableList'; | ||
|
|
||
| export default React.forwardRef(DraggableList); |
File renamed without changes.
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,11 @@ | ||
| import {PanResponder} from 'react-native'; | ||
|
|
||
| const InterceptPanResponderCapture = PanResponder.create({ | ||
| onStartShouldSetPanResponder: () => true, | ||
| onStartShouldSetPanResponderCapture: () => true, | ||
| onMoveShouldSetPanResponder: () => true, | ||
| onMoveShouldSetPanResponderCapture: () => true, | ||
| onPanResponderTerminationRequest: () => false, | ||
| }); | ||
|
|
||
| export default InterceptPanResponderCapture; |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Given the above checkbox has to be checked on both our checklists, I noticed that you're checking
ListFooterComponentdirectly which is typed asReact.ReactElementand this can be problematic if say a string is passed.We should make sure that we're evaluating a boolean, and for this I suggest React.
isValidElementto wrapListFooterComponentwhich checks whether a value is a React element -> returning a boolean.You can apply this to the styles check too!
Note: Make sure to run prettier once you're done with the modifications.
cc @suneox
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.
ListFooterComponent has type is React.ReactElement | undefinded so string or number can't match with this type so I'm also updated