@@ -187,18 +187,20 @@ protected void doFrameGuarded(long frameTimeNanos) {
187
187
}
188
188
};
189
189
190
- // We register as event listener at the end, because we pass `this` and we haven't finished
191
- // constructing an object yet.
192
- // This lead to a crash described in
193
- // https://github.com/software-mansion/react-native-reanimated/issues/604 which was caused by
194
- // Nodes Manager being constructed on UI thread and registering for events.
195
- // Events are handled in the native modules thread in the `onEventDispatch()` method.
196
- // This method indirectly uses `mChoreographerCallback` which was created after event
197
- // registration, creating race condition
198
- EventDispatcher eventDispatcher =
199
- Objects .requireNonNull (UIManagerHelper .getEventDispatcher (context , uiManagerType ));
200
- eventDispatcher .addListener (this );
201
- mUnsubscribe = () -> eventDispatcher .removeListener (this );
190
+ if (!BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
191
+ // We register as event listener at the end, because we pass `this` and we haven't finished
192
+ // constructing an object yet.
193
+ // This lead to a crash described in
194
+ // https://github.com/software-mansion/react-native-reanimated/issues/604 which was caused by
195
+ // Nodes Manager being constructed on UI thread and registering for events.
196
+ // Events are handled in the native modules thread in the `onEventDispatch()` method.
197
+ // This method indirectly uses `mChoreographerCallback` which was created after event
198
+ // registration, creating race condition
199
+ EventDispatcher eventDispatcher =
200
+ Objects .requireNonNull (UIManagerHelper .getEventDispatcher (context , uiManagerType ));
201
+ eventDispatcher .addListener (this );
202
+ mUnsubscribe = () -> eventDispatcher .removeListener (this );
203
+ }
202
204
203
205
mAnimationManager = new AnimationsManager (mContext , mUIManager );
204
206
}
0 commit comments