From aea1bdf348019f5579db2f47404726bf52ffbedd Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Mon, 8 Feb 2021 21:51:22 +0100 Subject: [PATCH] chore: added reanimated rc3 patch --- example/ios/Podfile.lock | 2 +- .../react-native-reanimated+2.0.0-rc.3.patch | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 example/patches/react-native-reanimated+2.0.0-rc.3.patch diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 6076625..32cea76 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -529,4 +529,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 63aff8b91a0d96d498f873a85ecd834b60be6eaf -COCOAPODS: 1.9.1 +COCOAPODS: 1.10.1 diff --git a/example/patches/react-native-reanimated+2.0.0-rc.3.patch b/example/patches/react-native-reanimated+2.0.0-rc.3.patch new file mode 100644 index 0000000..d0dc2b0 --- /dev/null +++ b/example/patches/react-native-reanimated+2.0.0-rc.3.patch @@ -0,0 +1,19 @@ +diff --git a/node_modules/react-native-reanimated/ios/native/NativeMethods.mm b/node_modules/react-native-reanimated/ios/native/NativeMethods.mm +index 58f1e20..505dd43 100644 +--- a/node_modules/react-native-reanimated/ios/native/NativeMethods.mm ++++ b/node_modules/react-native-reanimated/ios/native/NativeMethods.mm +@@ -37,14 +37,10 @@ + } + + +-NSString *eventDispatcherKey = @"eventDispatcher"; + void scrollTo(int scrollViewTag, RCTUIManager *uiManager, double x, double y, bool animated) { + UIView *view = [uiManager viewForReactTag:@(scrollViewTag)]; + RCTScrollView *scrollView = (RCTScrollView *) view; +- RCTEventDispatcher* oldEventDispatcher = [scrollView valueForKey:eventDispatcherKey]; +- [scrollView setValue:nil forKey:eventDispatcherKey]; + [scrollView scrollToOffset:(CGPoint){(CGFloat)x, (CGFloat)y} animated:animated]; +- [scrollView setValue:oldEventDispatcher forKey:eventDispatcherKey]; + } + + }