@@ -55,18 +55,10 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
55
55
}
56
56
GestureHandler .ACTION_TYPE_JS_FUNCTION_OLD_API -> {
57
57
// JS function, Animated.event with useNativeDriver: false using old API
58
- if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
59
- val data = RNGestureHandlerEvent .createEventData(
60
- handlerFactory.createEventBuilder(handler),
61
- )
62
- sendEventForDeviceEvent(RNGestureHandlerEvent .EVENT_NAME , data)
63
- } else {
64
- val event = RNGestureHandlerEvent .obtain(
65
- handler,
66
- handlerFactory.createEventBuilder(handler),
67
- )
68
- sendEventForDirectEvent(event)
69
- }
58
+ val data = RNGestureHandlerEvent .createEventData(
59
+ handlerFactory.createEventBuilder(handler),
60
+ )
61
+ sendEventForDeviceEvent(RNGestureHandlerEvent .EVENT_NAME , data)
70
62
}
71
63
GestureHandler .ACTION_TYPE_JS_FUNCTION_NEW_API -> {
72
64
// JS function, Animated.event with useNativeDriver: false using new API
@@ -99,22 +91,12 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
99
91
}
100
92
GestureHandler .ACTION_TYPE_NATIVE_ANIMATED_EVENT , GestureHandler .ACTION_TYPE_JS_FUNCTION_OLD_API -> {
101
93
// JS function or Animated.event with useNativeDriver: false with old API
102
- if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
103
- val data = RNGestureHandlerStateChangeEvent .createEventData(
104
- handlerFactory.createEventBuilder(handler),
105
- newState,
106
- oldState,
107
- )
108
- sendEventForDeviceEvent(RNGestureHandlerStateChangeEvent .EVENT_NAME , data)
109
- } else {
110
- val event = RNGestureHandlerStateChangeEvent .obtain(
111
- handler,
112
- newState,
113
- oldState,
114
- handlerFactory.createEventBuilder(handler),
115
- )
116
- sendEventForDirectEvent(event)
117
- }
94
+ val data = RNGestureHandlerStateChangeEvent .createEventData(
95
+ handlerFactory.createEventBuilder(handler),
96
+ newState,
97
+ oldState,
98
+ )
99
+ sendEventForDeviceEvent(RNGestureHandlerStateChangeEvent .EVENT_NAME , data)
118
100
}
119
101
GestureHandler .ACTION_TYPE_JS_FUNCTION_NEW_API -> {
120
102
// JS function or Animated.event with useNativeDriver: false with new API
@@ -160,13 +142,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
160
142
161
143
private fun <T : Event <T >> sendEventForReanimated (event : T ) {
162
144
// Delivers the event to Reanimated.
163
- if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
164
- // Send event directly to Reanimated
165
- reanimatedEventDispatcher.sendEvent(event, reactApplicationContext)
166
- } else {
167
- // In the old architecture, Reanimated subscribes for specific direct events.
168
- sendEventForDirectEvent(event)
169
- }
145
+ reanimatedEventDispatcher.sendEvent(event, reactApplicationContext)
170
146
}
171
147
172
148
private fun sendEventForNativeAnimatedEvent (event : RNGestureHandlerEvent ) {
0 commit comments