Repository navigation
One detector to rule them all #3732
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
akwasniewski
merged 121 commits into
next
from
@akwasniewski/separate-logic-native-detector
Oct 31, 2025
+260
−76
Merged
Changes from all commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
7d9de2e
logic detector web
4ccf49e
avoiding propsRef
69e1c5d
refactor
9959d8b
logicChildren in specs
1f1f681
ios
a982767
merge with next
81bf405
fix reanimated version
a90b83c
yarn lock
8c03f58
worklets
a3256d4
detach handlers
6f45a33
worklets fix
66390ab
android
1ef1969
Merge branch 'next' into @akwasniewski/logic-detector
3379714
yarn lock fix
e9795cc
removed circular dependency
7fb8ea9
simplify ios
5c24151
removed logic events web/android
593c44f
android and web refactor
fe1d67d
one path
b147c7b
merge with next
4e718b3
merge fix
8e9d2dc
adjust for reanimated/animated separation
97b7369
general refactor
8b6df8c
simplified attaching
dab9e5f
tag in callback
089bbf2
not sharing web invoke
5fbe993
renamed logic props
ddce1fb
logic animated event
50c1af4
removed child tag from web
5f3f1eb
safe detaching
1f22ef4
typo fix
3e7bc43
more typos
cd4d158
comment styling
164c4e8
moved detector context
84bdf3d
renamed helper function
4365e3e
explained invoke method
33fe818
isV3Api helper function
6c42eae
renamed logic children
a11b6d3
renamed var containing logic handlers
a70f868
action type helper on android
c0c9bb0
simplify logic children to delete creation
a2ee13d
removed redundant check
f0f24b8
renamed parent tag to host detector tag
f0fb458
removed unnecessary variable
5e5e917
renamed set
abcac98
separate function to detach all handlers
5c367b5
fix testing remnant
b1d620a
non default useDetectorContext
157d87b
android action type whitespace
a1b94d5
clean up extension
75f218b
removed remnants
344617a
renamed logic children web
03b37c7
android whitespace
9420ead
removed unnecessary annotation
06bb0e1
whitespace
474e301
delete obsolete
1fef44a
Fallthrough comment
cb9ab7a
defining registry outside of loop
76fd9ff
merge with next
2a727cb
cleaner extension function
e6fbdba
extract repetition
6fa67e3
moved file
31fad02
fix bad merge
c9ffbdb
better error
f00e0dd
Merge branch 'next' into @akwasniewski/logic-detector
akwasniewski 72e7813
updating logic children
79f1d96
removed unnecessary return
86ff725
hostGestureDetector property
7213108
extracted update logic children
8015ea5
rename logic children deleton set
e589043
move invoke detector event
57b6b57
auto type
a8fa637
rename isv3api
468e23f
no put
63d44f7
simplify mapping
0b362be
better web detaching
20038b1
typing
f3f985c
Merge branch 'next' into @akwasniewski/logic-detector
akwasniewski 832a039
passing helper function directly
1d96fa1
Merge branch 'next' into @akwasniewski/logic-detector
590a5cd
resolved workaround
f25cd9e
Merge branch 'next' into @akwasniewski/logic-detector
0f58258
empty set array
93412f4
avoiding indentation
df8c9b7
reformated native children detach
0cabeb7
fix logic error
adc3c22
send event refactor
149c323
moved empty set to utils
1bcda3c
fix can coalesce check to v3
f0ea23f
coalesce check in touch event
153385c
simplify logic props creation
765e326
Merge branch 'next' into @akwasniewski/logic-detector
fae6478
added delegate detector
f084754
extract common
c9b90f0
Merge branch 'next' into @akwasniewski/separate-logic-native-detector
akwasniewski 3a994b0
Merge branch 'next' into @akwasniewski/separate-logic-native-detector
akwasniewski 94d9079
merge could have been better
a9ab3a5
changed folder structure
743124e
extracted common
88d4290
renamed detectors folder
b7e9fcd
detector index
5ba432e
allowing delegate detector to not have a gesture specified
72f74a9
configuring relations in logic detector
113dc37
fix typo
95510d2
one detector to rule them all
2965de5
fix typo
90cf5d5
returning logic detector
359ca6c
Merge branch 'next' into @akwasniewski/separate-logic-native-detector
760d5ac
renamed delegate detector
103f778
renamed to intercepting gesture detector
eb6e762
not accessing context in v2
2c7df12
styling
0de96b3
export sczacher macher
f59defb
Merge branch 'next' into @akwasniewski/separate-logic-native-detector
8bcb96f
fix crashes on web
f7542cb
removed Provider
a6e6b58
fix ios
0dbbb2c
update comment
cc5ac64
finally fix ios
6b51db5
Merge branch 'next' into @akwasniewski/separate-logic-native-detector
akwasniewski 466bef3
update example
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
2 changes: 1 addition & 1 deletion
2
packages/react-native-gesture-handler/src/__tests__/RelationsTraversal.test.tsx
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
31 changes: 31 additions & 0 deletions
31
packages/react-native-gesture-handler/src/v3/detectors/GestureDetector.tsx
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,31 @@ | ||
| import { NativeDetectorProps } from './common'; | ||
| import { BaseGesture } from '../../handlers/gestures/gesture'; | ||
| import { NativeDetector } from './NativeDetector'; | ||
| import { ComposedGesture } from '../../handlers/gestures/gestureComposition'; | ||
| import { | ||
| GestureDetectorProps as LegacyGestureDetectorProps, | ||
| GestureDetector as LegacyGestureDetector, | ||
| } from '../../handlers/gestures/GestureDetector'; | ||
| import { DetectorContext } from './LogicDetector/useDetectorContext'; | ||
| import { LogicDetector } from './LogicDetector/LogicDetector'; | ||
| import { use } from 'react'; | ||
|
|
||
| export function GestureDetector<THandlerData, TConfig>( | ||
| props: NativeDetectorProps<THandlerData, TConfig> | LegacyGestureDetectorProps | ||
| ) { | ||
| if ( | ||
| props.gesture instanceof ComposedGesture || | ||
| props.gesture instanceof BaseGesture | ||
| ) { | ||
| return <LegacyGestureDetector {...(props as LegacyGestureDetectorProps)} />; | ||
| } | ||
|
|
||
| const context = use(DetectorContext); | ||
| return context ? ( | ||
| <LogicDetector {...(props as NativeDetectorProps<THandlerData, TConfig>)} /> | ||
| ) : ( | ||
| <NativeDetector | ||
| {...(props as NativeDetectorProps<THandlerData, TConfig>)} | ||
| /> | ||
| ); | ||
| } | ||
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
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
Oops, something went wrong.
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.
Please 🙏
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.
2c7df12