From ff6a044f66e0babeaf559880735362fa69590f7e Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 29 May 2024 05:02:49 +0100 Subject: Bump more Expo libs (#4251) * Bump more Expo libs * Use legacy camera API * fix `expo-notifications` patch * bump `menu` * change patch name * patch reanimated * Revert "patch reanimated" This reverts commit dad822d8ea04c71a609784114d60f2e67b78290b. * Use nightly reanimated * Revert "Use nightly reanimated" This reverts commit 6687c7182883feb889cbf2c67dd14890e06bc501. * Revert "Revert "patch reanimated"" This reverts commit c30abd6732f559ca04dc59698411e1058800d63e. --------- Co-authored-by: Hailey --- patches/expo-notifications+0.28.1.patch | 191 ------------------------ patches/expo-notifications+0.28.3.patch | 191 ++++++++++++++++++++++++ patches/expo-notifications-0.27.6.patch.md | 9 -- patches/expo-notifications-0.28.3.patch.md | 9 ++ patches/react-native-reanimated+3.11.0.patch | 209 +++++++++++++++++++++++++++ 5 files changed, 409 insertions(+), 200 deletions(-) delete mode 100644 patches/expo-notifications+0.28.1.patch create mode 100644 patches/expo-notifications+0.28.3.patch delete mode 100644 patches/expo-notifications-0.27.6.patch.md create mode 100644 patches/expo-notifications-0.28.3.patch.md (limited to 'patches') diff --git a/patches/expo-notifications+0.28.1.patch b/patches/expo-notifications+0.28.1.patch deleted file mode 100644 index 41e91446e..000000000 --- a/patches/expo-notifications+0.28.1.patch +++ /dev/null @@ -1,191 +0,0 @@ -diff --git a/node_modules/expo-notifications/android/build.gradle b/node_modules/expo-notifications/android/build.gradle -index d233e1f..cc2f856 100644 ---- a/node_modules/expo-notifications/android/build.gradle -+++ b/node_modules/expo-notifications/android/build.gradle -@@ -32,6 +32,7 @@ dependencies { - api 'com.google.firebase:firebase-messaging:22.0.0' - - api 'me.leolin:ShortcutBadger:1.1.22@aar' -+ implementation project(':expo-background-notification-handler') - - if (project.findProject(':expo-modules-test-core')) { - testImplementation project(':expo-modules-test-core') -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java -index 0af7fe0..8f2c8d8 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java -@@ -14,6 +14,7 @@ import expo.modules.notifications.notifications.enums.NotificationPriority; - import expo.modules.notifications.notifications.model.NotificationContent; - - public class JSONNotificationContentBuilder extends NotificationContent.Builder { -+ private static final String CHANNEL_ID_KEY = "channelId"; - private static final String TITLE_KEY = "title"; - private static final String TEXT_KEY = "message"; - private static final String SUBTITLE_KEY = "subtitle"; -@@ -36,6 +37,7 @@ public class JSONNotificationContentBuilder extends NotificationContent.Builder - - public NotificationContent.Builder setPayload(JSONObject payload) { - this.setTitle(getTitle(payload)) -+ .setChannelId(getChannelId(payload)) - .setSubtitle(getSubtitle(payload)) - .setText(getText(payload)) - .setBody(getBody(payload)) -@@ -60,6 +62,14 @@ public class JSONNotificationContentBuilder extends NotificationContent.Builder - return this; - } - -+ protected String getChannelId(JSONObject payload) { -+ try { -+ return payload.getString(CHANNEL_ID_KEY); -+ } catch (JSONException e) { -+ return null; -+ } -+ } -+ - protected String getTitle(JSONObject payload) { - try { - return payload.getString(TITLE_KEY); -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java -index f1fed19..166b34f 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java -@@ -20,6 +20,7 @@ import expo.modules.notifications.notifications.enums.NotificationPriority; - * should be created using {@link NotificationContent.Builder}. - */ - public class NotificationContent implements Parcelable, Serializable { -+ private string mChannelId; - private String mTitle; - private String mText; - private String mSubtitle; -@@ -50,6 +51,11 @@ public class NotificationContent implements Parcelable, Serializable { - } - }; - -+ @Nullable -+ public String getChannelId() { -+ return mTitle; -+ } -+ - @Nullable - public String getTitle() { - return mTitle; -@@ -121,6 +127,7 @@ public class NotificationContent implements Parcelable, Serializable { - } - - protected NotificationContent(Parcel in) { -+ mChannelId = in.readString(); - mTitle = in.readString(); - mText = in.readString(); - mSubtitle = in.readString(); -@@ -146,6 +153,7 @@ public class NotificationContent implements Parcelable, Serializable { - - @Override - public void writeToParcel(Parcel dest, int flags) { -+ dest.writeString(mChannelId); - dest.writeString(mTitle); - dest.writeString(mText); - dest.writeString(mSubtitle); -@@ -166,6 +174,7 @@ public class NotificationContent implements Parcelable, Serializable { - private static final long serialVersionUID = 397666843266836802L; - - private void writeObject(java.io.ObjectOutputStream out) throws IOException { -+ out.writeObject(mChannelId); - out.writeObject(mTitle); - out.writeObject(mText); - out.writeObject(mSubtitle); -@@ -190,6 +199,7 @@ public class NotificationContent implements Parcelable, Serializable { - } - - private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { -+ mChannelId = (String) in.readObject(); - mTitle = (String) in.readObject(); - mText = (String) in.readObject(); - mSubtitle = (String) in.readObject(); -@@ -240,6 +250,7 @@ public class NotificationContent implements Parcelable, Serializable { - } - - public static class Builder { -+ private string mChannelId; - private String mTitle; - private String mText; - private String mSubtitle; -@@ -260,6 +271,11 @@ public class NotificationContent implements Parcelable, Serializable { - useDefaultVibrationPattern(); - } - -+ public Builder setChannelId(String channelId) { -+ mChannelId = channelId; -+ return this; -+ } -+ - public Builder setTitle(String title) { - mTitle = title; - return this; -@@ -336,6 +352,7 @@ public class NotificationContent implements Parcelable, Serializable { - - public NotificationContent build() { - NotificationContent content = new NotificationContent(); -+ content.mChannelId = mChannelId; - content.mTitle = mTitle; - content.mSubtitle = mSubtitle; - content.mText = mText; -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java -index 6bd9928..ee93d70 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java -@@ -48,6 +48,10 @@ public class ExpoNotificationBuilder extends ChannelAwareNotificationBuilder { - - NotificationContent content = getNotificationContent(); - -+ if (content.getChannelId() != null) { -+ builder.setChannelId(content.getChannelId()); -+ } -+ - builder.setAutoCancel(content.isAutoDismiss()); - builder.setOngoing(content.isSticky()); - -diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt -index 55b3a8d..1b99d5b 100644 ---- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt -+++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt -@@ -12,11 +12,14 @@ import expo.modules.notifications.notifications.model.triggers.FirebaseNotificat - import expo.modules.notifications.service.NotificationsService - import expo.modules.notifications.service.interfaces.FirebaseMessagingDelegate - import expo.modules.notifications.tokens.interfaces.FirebaseTokenListener -+import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandler -+import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandlerInterface -+import expo.modules.backgroundnotificationhandler.ExpoBackgroundNotificationHandlerModule - import org.json.JSONObject - import java.lang.ref.WeakReference - import java.util.* - --open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate { -+open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate, BackgroundNotificationHandlerInterface { - companion object { - // Unfortunately we cannot save state between instances of a service other way - // than by static properties. Fortunately, using weak references we can -@@ -89,12 +92,21 @@ open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseM - fun getBackgroundTasks() = sBackgroundTaskConsumerReferences.values.mapNotNull { it.get() } - - override fun onMessageReceived(remoteMessage: RemoteMessage) { -- NotificationsService.receive(context, createNotification(remoteMessage)) -- getBackgroundTasks().forEach { -- it.scheduleJob(RemoteMessageSerializer.toBundle(remoteMessage)) -+ if (!ExpoBackgroundNotificationHandlerModule.isForegrounded) { -+ BackgroundNotificationHandler(context, this).handleMessage(remoteMessage) -+ return -+ } else { -+ showMessage(remoteMessage) -+ getBackgroundTasks().forEach { -+ it.scheduleJob(RemoteMessageSerializer.toBundle(remoteMessage)) -+ } - } - } - -+ override fun showMessage(remoteMessage: RemoteMessage) { -+ NotificationsService.receive(context, createNotification(remoteMessage)) -+ } -+ - protected fun createNotification(remoteMessage: RemoteMessage): Notification { - val identifier = getNotificationIdentifier(remoteMessage) - val payload = JSONObject(remoteMessage.data as Map<*, *>) diff --git a/patches/expo-notifications+0.28.3.patch b/patches/expo-notifications+0.28.3.patch new file mode 100644 index 000000000..3a9985c7b --- /dev/null +++ b/patches/expo-notifications+0.28.3.patch @@ -0,0 +1,191 @@ +diff --git a/node_modules/expo-notifications/android/build.gradle b/node_modules/expo-notifications/android/build.gradle +index d233e1f..cc2f856 100644 +--- a/node_modules/expo-notifications/android/build.gradle ++++ b/node_modules/expo-notifications/android/build.gradle +@@ -32,6 +32,7 @@ dependencies { + api 'com.google.firebase:firebase-messaging:22.0.0' + + api 'me.leolin:ShortcutBadger:1.1.22@aar' ++ implementation project(':expo-background-notification-handler') + + if (project.findProject(':expo-modules-test-core')) { + testImplementation project(':expo-modules-test-core') +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java +index 0af7fe0..8f2c8d8 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java +@@ -14,6 +14,7 @@ import expo.modules.notifications.notifications.enums.NotificationPriority; + import expo.modules.notifications.notifications.model.NotificationContent; + + public class JSONNotificationContentBuilder extends NotificationContent.Builder { ++ private static final String CHANNEL_ID_KEY = "channelId"; + private static final String TITLE_KEY = "title"; + private static final String TEXT_KEY = "message"; + private static final String SUBTITLE_KEY = "subtitle"; +@@ -36,6 +37,7 @@ public class JSONNotificationContentBuilder extends NotificationContent.Builder + + public NotificationContent.Builder setPayload(JSONObject payload) { + this.setTitle(getTitle(payload)) ++ .setChannelId(getChannelId(payload)) + .setSubtitle(getSubtitle(payload)) + .setText(getText(payload)) + .setBody(getBody(payload)) +@@ -60,6 +62,14 @@ public class JSONNotificationContentBuilder extends NotificationContent.Builder + return this; + } + ++ protected String getChannelId(JSONObject payload) { ++ try { ++ return payload.getString(CHANNEL_ID_KEY); ++ } catch (JSONException e) { ++ return null; ++ } ++ } ++ + protected String getTitle(JSONObject payload) { + try { + return payload.getString(TITLE_KEY); +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java +index f1fed19..80afe9e 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java +@@ -20,6 +20,7 @@ import expo.modules.notifications.notifications.enums.NotificationPriority; + * should be created using {@link NotificationContent.Builder}. + */ + public class NotificationContent implements Parcelable, Serializable { ++ private String mChannelId; + private String mTitle; + private String mText; + private String mSubtitle; +@@ -50,6 +51,11 @@ public class NotificationContent implements Parcelable, Serializable { + } + }; + ++ @Nullable ++ public String getChannelId() { ++ return mTitle; ++ } ++ + @Nullable + public String getTitle() { + return mTitle; +@@ -121,6 +127,7 @@ public class NotificationContent implements Parcelable, Serializable { + } + + protected NotificationContent(Parcel in) { ++ mChannelId = in.readString(); + mTitle = in.readString(); + mText = in.readString(); + mSubtitle = in.readString(); +@@ -146,6 +153,7 @@ public class NotificationContent implements Parcelable, Serializable { + + @Override + public void writeToParcel(Parcel dest, int flags) { ++ dest.writeString(mChannelId); + dest.writeString(mTitle); + dest.writeString(mText); + dest.writeString(mSubtitle); +@@ -166,6 +174,7 @@ public class NotificationContent implements Parcelable, Serializable { + private static final long serialVersionUID = 397666843266836802L; + + private void writeObject(java.io.ObjectOutputStream out) throws IOException { ++ out.writeObject(mChannelId); + out.writeObject(mTitle); + out.writeObject(mText); + out.writeObject(mSubtitle); +@@ -190,6 +199,7 @@ public class NotificationContent implements Parcelable, Serializable { + } + + private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { ++ mChannelId = (String) in.readObject(); + mTitle = (String) in.readObject(); + mText = (String) in.readObject(); + mSubtitle = (String) in.readObject(); +@@ -240,6 +250,7 @@ public class NotificationContent implements Parcelable, Serializable { + } + + public static class Builder { ++ private String mChannelId; + private String mTitle; + private String mText; + private String mSubtitle; +@@ -260,6 +271,11 @@ public class NotificationContent implements Parcelable, Serializable { + useDefaultVibrationPattern(); + } + ++ public Builder setChannelId(String channelId) { ++ mChannelId = channelId; ++ return this; ++ } ++ + public Builder setTitle(String title) { + mTitle = title; + return this; +@@ -336,6 +352,7 @@ public class NotificationContent implements Parcelable, Serializable { + + public NotificationContent build() { + NotificationContent content = new NotificationContent(); ++ content.mChannelId = mChannelId; + content.mTitle = mTitle; + content.mSubtitle = mSubtitle; + content.mText = mText; +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java +index 6bd9928..ee93d70 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java +@@ -48,6 +48,10 @@ public class ExpoNotificationBuilder extends ChannelAwareNotificationBuilder { + + NotificationContent content = getNotificationContent(); + ++ if (content.getChannelId() != null) { ++ builder.setChannelId(content.getChannelId()); ++ } ++ + builder.setAutoCancel(content.isAutoDismiss()); + builder.setOngoing(content.isSticky()); + +diff --git a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt +index 55b3a8d..1b99d5b 100644 +--- a/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt ++++ b/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt +@@ -12,11 +12,14 @@ import expo.modules.notifications.notifications.model.triggers.FirebaseNotificat + import expo.modules.notifications.service.NotificationsService + import expo.modules.notifications.service.interfaces.FirebaseMessagingDelegate + import expo.modules.notifications.tokens.interfaces.FirebaseTokenListener ++import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandler ++import expo.modules.backgroundnotificationhandler.BackgroundNotificationHandlerInterface ++import expo.modules.backgroundnotificationhandler.ExpoBackgroundNotificationHandlerModule + import org.json.JSONObject + import java.lang.ref.WeakReference + import java.util.* + +-open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate { ++open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseMessagingDelegate, BackgroundNotificationHandlerInterface { + companion object { + // Unfortunately we cannot save state between instances of a service other way + // than by static properties. Fortunately, using weak references we can +@@ -89,12 +92,21 @@ open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseM + fun getBackgroundTasks() = sBackgroundTaskConsumerReferences.values.mapNotNull { it.get() } + + override fun onMessageReceived(remoteMessage: RemoteMessage) { +- NotificationsService.receive(context, createNotification(remoteMessage)) +- getBackgroundTasks().forEach { +- it.scheduleJob(RemoteMessageSerializer.toBundle(remoteMessage)) ++ if (!ExpoBackgroundNotificationHandlerModule.isForegrounded) { ++ BackgroundNotificationHandler(context, this).handleMessage(remoteMessage) ++ return ++ } else { ++ showMessage(remoteMessage) ++ getBackgroundTasks().forEach { ++ it.scheduleJob(RemoteMessageSerializer.toBundle(remoteMessage)) ++ } + } + } + ++ override fun showMessage(remoteMessage: RemoteMessage) { ++ NotificationsService.receive(context, createNotification(remoteMessage)) ++ } ++ + protected fun createNotification(remoteMessage: RemoteMessage): Notification { + val identifier = getNotificationIdentifier(remoteMessage) + val payload = JSONObject(remoteMessage.data as Map<*, *>) diff --git a/patches/expo-notifications-0.27.6.patch.md b/patches/expo-notifications-0.27.6.patch.md deleted file mode 100644 index 59b2598f3..000000000 --- a/patches/expo-notifications-0.27.6.patch.md +++ /dev/null @@ -1,9 +0,0 @@ -## LOAD BEARING PATCH, DO NOT REMOVE - -## Expo-Notifications Patch - -This patch supports the Android background notification handling module. Incoming messages -in `onMessageReceived` are sent to the module for handling. - -It also allows us to set the Android notification channel ID from the notification `data`, rather -than the `notification` object in the payload. diff --git a/patches/expo-notifications-0.28.3.patch.md b/patches/expo-notifications-0.28.3.patch.md new file mode 100644 index 000000000..59b2598f3 --- /dev/null +++ b/patches/expo-notifications-0.28.3.patch.md @@ -0,0 +1,9 @@ +## LOAD BEARING PATCH, DO NOT REMOVE + +## Expo-Notifications Patch + +This patch supports the Android background notification handling module. Incoming messages +in `onMessageReceived` are sent to the module for handling. + +It also allows us to set the Android notification channel ID from the notification `data`, rather +than the `notification` object in the payload. diff --git a/patches/react-native-reanimated+3.11.0.patch b/patches/react-native-reanimated+3.11.0.patch index f18985385..9147cf08e 100644 --- a/patches/react-native-reanimated+3.11.0.patch +++ b/patches/react-native-reanimated+3.11.0.patch @@ -1,3 +1,212 @@ +diff --git a/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts b/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts +index 92ebe62..5f8207e 100644 +--- a/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts ++++ b/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts +@@ -96,7 +96,8 @@ export interface AnimatedComponentRef extends Component { + export interface IAnimatedComponentInternal { + _styles: StyleProps[] | null; + _animatedProps?: Partial>; +- _viewTag: number; ++ _componentViewTag: number; ++ _eventViewTag: number; + _isFirstRender: boolean; + jestAnimatedStyle: { value: StyleProps }; + _component: AnimatedComponentRef | HTMLElement | null; +diff --git a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx +index 88b3fdf..2488ebc 100644 +--- a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx ++++ b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx +@@ -122,7 +122,8 @@ export function createAnimatedComponent( + { + _styles: StyleProps[] | null = null; + _animatedProps?: Partial>; +- _viewTag = -1; ++ _componentViewTag = -1; ++ _eventViewTag = -1; + _isFirstRender = true; + jestAnimatedStyle: { value: StyleProps } = { value: {} }; + _component: AnimatedComponentRef | HTMLElement | null = null; +@@ -143,7 +144,8 @@ export function createAnimatedComponent( + } + + componentDidMount() { +- this._viewTag = this._getViewInfo().viewTag as number; ++ this._setComponentViewTag(); ++ this._setEventViewTag(); + this._attachNativeEvents(); + this._jsPropsUpdater.addOnJSPropsChangeListener(this); + this._attachAnimatedStyles(); +@@ -185,7 +187,10 @@ export function createAnimatedComponent( + if (this.props.sharedTransitionTag) { + this._configureSharedTransition(true); + } +- this._sharedElementTransition?.unregisterTransition(this._viewTag, true); ++ this._sharedElementTransition?.unregisterTransition( ++ this._componentViewTag, ++ true ++ ); + + const exiting = this.props.exiting; + if ( +@@ -209,7 +214,7 @@ export function createAnimatedComponent( + : getReduceMotionFromConfig(); + if (!reduceMotionInExiting) { + updateLayoutAnimations( +- this._viewTag, ++ this._componentViewTag, + LayoutAnimationType.EXITING, + maybeBuild( + exiting, +@@ -221,12 +226,22 @@ export function createAnimatedComponent( + } + } + +- _getEventViewRef() { +- // Make sure to get the scrollable node for components that implement +- // `ScrollResponder.Mixin`. +- return (this._component as AnimatedComponentRef)?.getScrollableNode +- ? (this._component as AnimatedComponentRef).getScrollableNode?.() +- : this._component; ++ _setComponentViewTag() { ++ this._componentViewTag = this._getViewInfo().viewTag as number; ++ } ++ ++ _setEventViewTag() { ++ // Setting the tag for registering events - since the event emitting view can be nested inside the main component ++ const componentAnimatedRef = this._component as AnimatedComponentRef; ++ if (componentAnimatedRef.getScrollableNode) { ++ const scrollableNode = componentAnimatedRef.getScrollableNode(); ++ this._eventViewTag = findNodeHandle(scrollableNode) ?? -1; ++ } else { ++ this._eventViewTag = ++ findNodeHandle( ++ options?.setNativeProps ? this : componentAnimatedRef ++ ) ?? -1; ++ } + } + + _attachNativeEvents() { +@@ -236,7 +251,7 @@ export function createAnimatedComponent( + has('workletEventHandler', prop) && + prop.workletEventHandler instanceof WorkletEventHandler + ) { +- prop.workletEventHandler.registerForEvents(this._viewTag, key); ++ prop.workletEventHandler.registerForEvents(this._eventViewTag, key); + } + } + } +@@ -248,7 +263,7 @@ export function createAnimatedComponent( + has('workletEventHandler', prop) && + prop.workletEventHandler instanceof WorkletEventHandler + ) { +- prop.workletEventHandler.unregisterFromEvents(this._viewTag); ++ prop.workletEventHandler.unregisterFromEvents(this._eventViewTag); + } + } + } +@@ -258,15 +273,17 @@ export function createAnimatedComponent( + for (const style of this._styles) { + style.viewsRef.remove(this); + } +- } else if (this._viewTag !== -1 && this._styles !== null) { ++ } else if (this._componentViewTag !== -1 && this._styles !== null) { + for (const style of this._styles) { +- style.viewDescriptors.remove(this._viewTag); ++ style.viewDescriptors.remove(this._componentViewTag); + } + if (this.props.animatedProps?.viewDescriptors) { +- this.props.animatedProps.viewDescriptors.remove(this._viewTag); ++ this.props.animatedProps.viewDescriptors.remove( ++ this._componentViewTag ++ ); + } + if (isFabric()) { +- removeFromPropsRegistry(this._viewTag); ++ removeFromPropsRegistry(this._componentViewTag); + } + } + } +@@ -283,15 +300,19 @@ export function createAnimatedComponent( + const newProp = this.props[key]; + if (!newProp) { + // Prop got deleted +- prevProp.workletEventHandler.unregisterFromEvents(this._viewTag); ++ prevProp.workletEventHandler.unregisterFromEvents( ++ this._eventViewTag ++ ); + } else if ( + has('workletEventHandler', newProp) && + newProp.workletEventHandler instanceof WorkletEventHandler && + newProp.workletEventHandler !== prevProp.workletEventHandler + ) { + // Prop got changed +- prevProp.workletEventHandler.unregisterFromEvents(this._viewTag); +- newProp.workletEventHandler.registerForEvents(this._viewTag); ++ prevProp.workletEventHandler.unregisterFromEvents( ++ this._eventViewTag ++ ); ++ newProp.workletEventHandler.registerForEvents(this._eventViewTag); + } + } + } +@@ -304,7 +325,7 @@ export function createAnimatedComponent( + !prevProps[key] + ) { + // Prop got added +- newProp.workletEventHandler.registerForEvents(this._viewTag); ++ newProp.workletEventHandler.registerForEvents(this._eventViewTag); + } + } + } +@@ -381,7 +402,7 @@ export function createAnimatedComponent( + adaptViewConfig(viewConfig); + } + +- this._viewTag = viewTag as number; ++ this._componentViewTag = viewTag as number; + + // remove old styles + if (prevStyles) { +@@ -487,7 +508,11 @@ export function createAnimatedComponent( + AnimatedComponent.displayName + ) + : undefined; +- updateLayoutAnimations(this._viewTag, LayoutAnimationType.LAYOUT, layout); ++ updateLayoutAnimations( ++ this._componentViewTag, ++ LayoutAnimationType.LAYOUT, ++ layout ++ ); + } + + _configureSharedTransition(isUnmounting = false) { +@@ -497,7 +522,7 @@ export function createAnimatedComponent( + const { sharedTransitionTag } = this.props; + if (!sharedTransitionTag) { + this._sharedElementTransition?.unregisterTransition( +- this._viewTag, ++ this._componentViewTag, + isUnmounting + ); + this._sharedElementTransition = null; +@@ -508,7 +533,7 @@ export function createAnimatedComponent( + this._sharedElementTransition ?? + new SharedTransition(); + sharedElementTransition.registerTransition( +- this._viewTag, ++ this._componentViewTag, + sharedTransitionTag, + isUnmounting + ); +@@ -527,7 +552,7 @@ export function createAnimatedComponent( + ? (ref as HTMLElement) + : findNodeHandle(ref as Component); + +- this._viewTag = tag as number; ++ this._componentViewTag = tag as number; + + const { layout, entering, exiting, sharedTransitionTag } = this.props; + if ( diff --git a/node_modules/react-native-reanimated/lib/module/reanimated2/index.js b/node_modules/react-native-reanimated/lib/module/reanimated2/index.js index ac9be5d..86d4605 100644 --- a/node_modules/react-native-reanimated/lib/module/reanimated2/index.js -- cgit 1.4.1