react-native-reanimated 2.3.0-beta.3 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +9 -0
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +13 -0
- package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +38 -2
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +3 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +5 -0
- package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +2 -0
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -7
- package/README.md +1 -1
- package/RNReanimated.podspec +20 -3
- package/android/build.gradle +31 -5
- package/android/expo/linking.gradle +46 -0
- package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +12 -0
- package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +26 -0
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/expo-module.config.json +3 -0
- package/ios/LayoutReanimation/REAAnimationsManager.m +64 -19
- package/ios/LayoutReanimation/REAUIManager.mm +63 -18
- package/ios/Nodes/REAPropsNode.m +1 -1
- package/ios/REAEventDispatcher.m +1 -1
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +0 -3
- package/ios/REANodesManager.m +1 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/native/NativeMethods.h +5 -0
- package/ios/native/NativeMethods.mm +8 -1
- package/ios/native/NativeProxy.h +1 -0
- package/ios/native/NativeProxy.mm +10 -2
- package/ios/native/REAInitializer.mm +7 -3
- package/lib/src/Animated.js +31 -0
- package/lib/{ConfigHelper.js → src/ConfigHelper.js} +0 -0
- package/lib/{ReanimatedEventEmitter.js → src/ReanimatedEventEmitter.js} +0 -0
- package/lib/{ReanimatedModule.js → src/ReanimatedModule.js} +0 -0
- package/lib/{ReanimatedModule.macos.js → src/ReanimatedModule.macos.js} +0 -0
- package/lib/{ReanimatedModule.native.js → src/ReanimatedModule.native.js} +0 -0
- package/lib/{ReanimatedModule.windows.js → src/ReanimatedModule.windows.js} +0 -0
- package/lib/{ReanimatedModuleCompat.js → src/ReanimatedModuleCompat.js} +0 -0
- package/lib/{__mocks__ → src/__mocks__}/ReanimatedEventEmitter.js +0 -0
- package/lib/{__mocks__ → src/__mocks__}/ReanimatedModule.native.js +0 -0
- package/lib/{createAnimatedComponent.js → src/createAnimatedComponent.js} +55 -37
- package/lib/src/index.js +31 -0
- package/lib/{reanimated1 → src/reanimated1}/Easing.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/SpringConfig.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/Transitioning.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/Animation.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/SpringUtils.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/backwardCompatibleAnimWrapper.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/decay.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/spring.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/timing.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/base.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedAlways.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedBezier.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedBlock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCall.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCallFunc.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedClockTest.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedConcat.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCond.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedDebug.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedEvent.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedFunction.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedNode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedOperator.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedParam.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedProps.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedSet.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStartClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStopClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStyle.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedTransform.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/Core.test.js +1 -1
- package/lib/{reanimated1 → src/reanimated1}/core/InternalAnimatedValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/__mocks__/AnimatedProps.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/createEventObjectProxyPolyfill.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/__mocks__/evaluateOnce.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/acc.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/color.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/diff.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/diffClamp.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/evaluateOnce.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/index.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/interpolate.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/interpolateColors.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/onChange.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/useCode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/index.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/operators.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/useValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/val.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Bezier.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Colors.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Easing.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeMethods.js +7 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/NativeReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/PlatformChecker.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/PropAdapters.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/UpdateProps.js +1 -1
- package/lib/{reanimated2 → src/reanimated2}/ViewDescriptorsSet.js +4 -2
- package/lib/{reanimated2 → src/reanimated2}/WorkletEventHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/MutableValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/NativeReanimated.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/NativeReanimated.native.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/decay.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/delay.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/repeat.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/sequence.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/spring.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/styleAnimation.js +5 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/timing.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/util.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/commonTypes.js +0 -0
- package/lib/src/reanimated2/component/FlatList.js +30 -0
- package/lib/src/reanimated2/component/WrappedComponents.js +9 -0
- package/lib/src/reanimated2/component/index.js +4 -0
- package/lib/{reanimated2 → src/reanimated2}/core.js +27 -3
- package/lib/{reanimated2 → src/reanimated2}/globals.d.ts +5 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/Hooks.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedGestureHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedReaction.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedRef.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedScrollHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedStyle.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useDerivedValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useSharedValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/utils.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/interpolation.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/jestUtils.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/JSReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/Mapper.js +4 -1
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/MapperRegistry.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/MutableValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/index.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/LayoutAnimationRepository.js +14 -5
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/Keyframe.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Bounce.js +0 -0
- package/lib/src/reanimated2/layoutReanimation/defaultAnimations/Default.js +36 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Fade.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Flip.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Roll.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Rotate.js +16 -16
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Slide.js +16 -16
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Stretch.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Zoom.js +4 -4
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.js +20 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.js +3 -3
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.js +10 -10
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/mock.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/platform-specific/RNRenderer.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/platform-specific/RNRenderer.web.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/utils.js +0 -0
- package/lib/{setAndForwardRef.js → src/setAndForwardRef.js} +0 -0
- package/mock.js +1 -1
- package/package.json +4 -3
- package/plugin.js +10 -3
- package/react-native-reanimated.d.ts +40 -23
- package/src/Animated.js +11 -5
- package/src/createAnimatedComponent.tsx +86 -43
- package/src/reanimated1/core/Core.test.js +1 -1
- package/src/reanimated2/NativeMethods.ts +13 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +4 -0
- package/src/reanimated2/UpdateProps.ts +1 -1
- package/src/reanimated2/ViewDescriptorsSet.ts +6 -2
- package/src/reanimated2/animation/styleAnimation.ts +9 -0
- package/src/reanimated2/component/FlatList.tsx +44 -0
- package/src/reanimated2/component/WrappedComponents.ts +11 -0
- package/src/reanimated2/component/index.ts +9 -0
- package/src/reanimated2/core.ts +38 -3
- package/src/reanimated2/globals.d.ts +5 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +6 -0
- package/src/reanimated2/js-reanimated/Mapper.ts +3 -1
- package/src/reanimated2/js-reanimated/index.ts +5 -0
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +18 -5
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +39 -20
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +5 -1
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +21 -15
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +29 -24
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +61 -34
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +49 -34
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +17 -12
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +20 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +9 -9
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +8 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +20 -14
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +14 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +24 -12
- package/lib/Animated.js +0 -25
- package/lib/index.js +0 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
#import "REAUIManager.h"
|
|
2
2
|
#import <Foundation/Foundation.h>
|
|
3
|
-
#
|
|
4
|
-
#import "RCTLayoutAnimation.h"
|
|
5
|
-
#import "RCTLayoutAnimationGroup.h"
|
|
6
|
-
#import "RCTRootShadowView.h"
|
|
7
|
-
#import "RCTRootViewInternal.h"
|
|
8
|
-
#import "RCTUIManagerObserverCoordinator.h"
|
|
3
|
+
#include "FeaturesConfig.h"
|
|
9
4
|
#import "REAIOSScheduler.h"
|
|
10
5
|
#include "Scheduler.h"
|
|
11
6
|
|
|
7
|
+
#import <React/RCTComponentData.h>
|
|
8
|
+
#import <React/RCTLayoutAnimation.h>
|
|
9
|
+
#import <React/RCTLayoutAnimationGroup.h>
|
|
10
|
+
#import <React/RCTModalHostView.h>
|
|
11
|
+
#import <React/RCTRootShadowView.h>
|
|
12
|
+
#import <React/RCTRootViewInternal.h>
|
|
13
|
+
#import <React/RCTUIManagerObserverCoordinator.h>
|
|
14
|
+
|
|
12
15
|
#if __has_include(<RNScreens/RNSScreen.h>)
|
|
13
16
|
#import <RNScreens/RNSScreen.h>
|
|
14
17
|
#endif
|
|
@@ -70,16 +73,29 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
70
73
|
removeAtIndices:(NSArray<NSNumber *> *)removeAtIndices
|
|
71
74
|
registry:(NSMutableDictionary<NSNumber *, id<RCTComponent>> *)registry
|
|
72
75
|
{
|
|
76
|
+
if (!reanimated::FeaturesConfig::isLayoutAnimationEnabled()) {
|
|
77
|
+
[super _manageChildren:containerTag
|
|
78
|
+
moveFromIndices:moveFromIndices
|
|
79
|
+
moveToIndices:moveToIndices
|
|
80
|
+
addChildReactTags:addChildReactTags
|
|
81
|
+
addAtIndices:addAtIndices
|
|
82
|
+
removeAtIndices:removeAtIndices
|
|
83
|
+
registry:registry];
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Reanimated changes /start
|
|
73
88
|
BOOL isUIViewRegistry = ((id)registry == (id)[self valueForKey:@"_viewRegistry"]);
|
|
74
89
|
id<RCTComponent> container;
|
|
75
|
-
|
|
90
|
+
NSMutableArray<id<RCTComponent>> *permanentlyRemovedChildren;
|
|
76
91
|
if (isUIViewRegistry) {
|
|
77
92
|
container = registry[containerTag];
|
|
78
93
|
for (id<RCTComponent> toRemoveChild in _toBeRemovedRegister[containerTag]) {
|
|
79
94
|
[container removeReactSubview:toRemoveChild];
|
|
80
95
|
}
|
|
81
96
|
|
|
82
|
-
permanentlyRemovedChildren = [super _childrenToRemoveFromContainer:container
|
|
97
|
+
permanentlyRemovedChildren = (NSMutableArray *)[super _childrenToRemoveFromContainer:container
|
|
98
|
+
atIndices:removeAtIndices];
|
|
83
99
|
if (permanentlyRemovedChildren != nil) {
|
|
84
100
|
for (id<RCTComponent> permanentlyRemovedChild in permanentlyRemovedChildren) {
|
|
85
101
|
if (_toBeRemovedRegister[containerTag] == nil) {
|
|
@@ -89,6 +105,7 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
89
105
|
}
|
|
90
106
|
}
|
|
91
107
|
}
|
|
108
|
+
// Reanimated changes /end
|
|
92
109
|
|
|
93
110
|
[super _manageChildren:containerTag
|
|
94
111
|
moveFromIndices:moveFromIndices
|
|
@@ -98,6 +115,7 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
98
115
|
removeAtIndices:removeAtIndices
|
|
99
116
|
registry:registry];
|
|
100
117
|
|
|
118
|
+
// Reanimated changes /start
|
|
101
119
|
if (isUIViewRegistry) {
|
|
102
120
|
NSMutableDictionary<NSNumber *, id<RCTComponent>> *viewRegistry = [self valueForKey:@"_viewRegistry"];
|
|
103
121
|
for (id<RCTComponent> toRemoveChild in _toBeRemovedRegister[containerTag]) {
|
|
@@ -105,14 +123,27 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
105
123
|
if (lastIndex < 0) {
|
|
106
124
|
lastIndex = 0;
|
|
107
125
|
}
|
|
108
|
-
[
|
|
109
|
-
|
|
126
|
+
if ([toRemoveChild isKindOfClass:[RCTModalHostView class]]
|
|
127
|
+
#if __has_include(<RNScreens/RNSScreen.h>)
|
|
128
|
+
|| ([toRemoveChild isKindOfClass:[RNSScreenView class]])
|
|
129
|
+
#endif
|
|
130
|
+
) {
|
|
131
|
+
// we don't want layout animations when removing modals or Screens of native-stack since it brings buggy
|
|
132
|
+
// behavior
|
|
133
|
+
[_toBeRemovedRegister[container.reactTag] removeObject:toRemoveChild];
|
|
134
|
+
[permanentlyRemovedChildren removeObject:toRemoveChild];
|
|
135
|
+
|
|
136
|
+
} else {
|
|
137
|
+
[container insertReactSubview:toRemoveChild atIndex:lastIndex];
|
|
138
|
+
viewRegistry[toRemoveChild.reactTag] = toRemoveChild;
|
|
139
|
+
}
|
|
110
140
|
}
|
|
111
141
|
|
|
112
142
|
for (UIView *removedChild in permanentlyRemovedChildren) {
|
|
113
143
|
[self callAnimationForTree:removedChild parentTag:containerTag];
|
|
114
144
|
}
|
|
115
145
|
}
|
|
146
|
+
// Reanimated changes /end
|
|
116
147
|
}
|
|
117
148
|
|
|
118
149
|
- (void)callAnimationForTree:(UIView *)view parentTag:(NSNumber *)parentTag
|
|
@@ -239,7 +270,13 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
239
270
|
view.hidden = isHidden;
|
|
240
271
|
}
|
|
241
272
|
|
|
242
|
-
|
|
273
|
+
// Reanimated changes /start
|
|
274
|
+
REASnapshot *snapshotBefore;
|
|
275
|
+
if (reanimated::FeaturesConfig::isLayoutAnimationEnabled()) {
|
|
276
|
+
snapshotBefore = [[REASnapshot alloc] init:view];
|
|
277
|
+
}
|
|
278
|
+
// Reanimated changes /end
|
|
279
|
+
|
|
243
280
|
if (creatingLayoutAnimation) {
|
|
244
281
|
// Animate view creation
|
|
245
282
|
[view reactSetFrame:frame];
|
|
@@ -285,18 +322,23 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
285
322
|
completion(YES);
|
|
286
323
|
}
|
|
287
324
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
325
|
+
// Reanimated changes /start
|
|
326
|
+
if (reanimated::FeaturesConfig::isLayoutAnimationEnabled()) {
|
|
327
|
+
if (isNew) {
|
|
328
|
+
REASnapshot *snapshot = [[REASnapshot alloc] init:view];
|
|
329
|
+
[_animationsManager onViewCreate:view after:snapshot];
|
|
330
|
+
} else {
|
|
331
|
+
REASnapshot *snapshotAfter = [[REASnapshot alloc] init:view];
|
|
332
|
+
[_animationsManager onViewUpdate:view before:snapshotBefore after:snapshotAfter];
|
|
333
|
+
}
|
|
294
334
|
}
|
|
295
335
|
}
|
|
296
336
|
|
|
297
337
|
[_animationsManager removeLeftovers];
|
|
298
338
|
// Clean up
|
|
339
|
+
// uiManager->_layoutAnimationGroup = nil;
|
|
299
340
|
[uiManager setValue:nil forKey:@"_layoutAnimationGroup"];
|
|
341
|
+
// Reanimated changes /end
|
|
300
342
|
};
|
|
301
343
|
}
|
|
302
344
|
|
|
@@ -331,7 +373,10 @@ std::weak_ptr<reanimated::Scheduler> _scheduler;
|
|
|
331
373
|
NSMutableDictionary<NSNumber *, id<RCTComponent>> *viewRegistry = [self valueForKey:@"_viewRegistry"];
|
|
332
374
|
[view.reactSuperview removeReactSubview:view];
|
|
333
375
|
id<RCTComponent> parentView = viewRegistry[tag];
|
|
334
|
-
|
|
376
|
+
@try {
|
|
377
|
+
[parentView removeReactSubview:view];
|
|
378
|
+
} @catch (id anException) {
|
|
379
|
+
}
|
|
335
380
|
#if __has_include(<RNScreens/RNSScreen.h>)
|
|
336
381
|
if ([view isKindOfClass:[RNSScreenView class]]) {
|
|
337
382
|
[parentView didUpdateReactSubviews];
|
package/ios/Nodes/REAPropsNode.m
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
#import "REANodesManager.h"
|
|
5
5
|
#import "REAStyleNode.h"
|
|
6
6
|
|
|
7
|
+
#import <React/RCTComponentData.h>
|
|
7
8
|
#import <React/RCTLog.h>
|
|
8
9
|
#import <React/RCTUIManager.h>
|
|
9
|
-
#import "React/RCTComponentData.h"
|
|
10
10
|
|
|
11
11
|
@implementation REAPropsNode {
|
|
12
12
|
NSNumber *_connectedViewTag;
|
package/ios/REAEventDispatcher.m
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
- (void)sendEvent:(id<RCTEvent>)event
|
|
9
9
|
{
|
|
10
|
-
[[
|
|
10
|
+
[[[self bridge] moduleForName:@"ReanimatedModule"] eventDispatcherWillDispatchEvent:event];
|
|
11
11
|
[super sendEvent:event];
|
|
12
12
|
}
|
|
13
13
|
|
package/ios/REAModule.h
CHANGED
package/ios/REAModule.m
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
typedef void (^AnimatedOperation)(REANodesManager *nodesManager);
|
|
8
8
|
|
|
9
|
-
RCTBridge *_bridge_reanimated = nil;
|
|
10
|
-
|
|
11
9
|
@implementation REAModule {
|
|
12
10
|
NSMutableArray<AnimatedOperation> *_operations;
|
|
13
11
|
REATransitionManager *_transitionManager;
|
|
@@ -17,7 +15,6 @@ RCT_EXPORT_MODULE(ReanimatedModule);
|
|
|
17
15
|
|
|
18
16
|
- (void)invalidate
|
|
19
17
|
{
|
|
20
|
-
_bridge_reanimated = nil;
|
|
21
18
|
_transitionManager = nil;
|
|
22
19
|
[_nodesManager invalidate];
|
|
23
20
|
[self.bridge.uiManager.observerCoordinator removeObserver:self];
|
package/ios/REANodesManager.m
CHANGED
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onAnimationFrame:)];
|
|
119
|
+
_displayLink.preferredFramesPerSecond = 120; // will fallback to 60 fps for devices without Pro Motion display
|
|
119
120
|
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
|
120
121
|
[_displayLink setPaused:true];
|
|
121
122
|
return self;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include <utility>
|
|
6
6
|
#include <vector>
|
|
7
7
|
#import <vector>
|
|
8
|
+
#import "RNGestureHandlerStateManager.h"
|
|
8
9
|
|
|
9
10
|
namespace reanimated {
|
|
10
11
|
|
|
@@ -17,5 +18,9 @@ void scrollTo(
|
|
|
17
18
|
double x,
|
|
18
19
|
double y,
|
|
19
20
|
bool animated);
|
|
21
|
+
void setGestureState(
|
|
22
|
+
id<RNGestureHandlerStateManager> gestureHandlerStateManager,
|
|
23
|
+
int handlerTag,
|
|
24
|
+
int newState);
|
|
20
25
|
|
|
21
26
|
} // namespace reanimated
|
|
@@ -18,7 +18,7 @@ std::vector<std::pair<std::string, double>> measure(int viewTag, RCTUIManager *u
|
|
|
18
18
|
rootView = rootView.superview;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
if (rootView == nil
|
|
21
|
+
if (rootView == nil) {
|
|
22
22
|
return std::vector<std::pair<std::string, double>>(1, std::make_pair("x", -1234567.0));
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -44,4 +44,11 @@ void scrollTo(int scrollViewTag, RCTUIManager *uiManager, double x, double y, bo
|
|
|
44
44
|
[scrollView scrollToOffset:(CGPoint){(CGFloat)x, (CGFloat)y} animated:animated];
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
void setGestureState(id<RNGestureHandlerStateManager> gestureHandlerStateManager, int handlerTag, int newState)
|
|
48
|
+
{
|
|
49
|
+
if (gestureHandlerStateManager != nil) {
|
|
50
|
+
[gestureHandlerStateManager setGestureState:newState forHandler:handlerTag];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
47
54
|
}
|
package/ios/native/NativeProxy.h
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#import "REAModule.h"
|
|
13
13
|
#import "REANodesManager.h"
|
|
14
14
|
#import "REAUIManager.h"
|
|
15
|
+
#import "RNGestureHandlerStateManager.h"
|
|
15
16
|
|
|
16
17
|
#if __has_include(<reacthermes/HermesExecutorFactory.h>)
|
|
17
18
|
#import <reacthermes/HermesExecutorFactory.h>
|
|
@@ -86,9 +87,10 @@ static id convertJSIValueToObjCObject(jsi::Runtime &runtime, const jsi::Value &v
|
|
|
86
87
|
throw std::runtime_error("Unsupported jsi::jsi::Value kind");
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
std::shared_ptr<NativeReanimatedModule> createReanimatedModule(
|
|
90
|
+
std::shared_ptr<NativeReanimatedModule> createReanimatedModule(
|
|
91
|
+
RCTBridge *bridge,
|
|
92
|
+
std::shared_ptr<CallInvoker> jsInvoker)
|
|
90
93
|
{
|
|
91
|
-
RCTBridge *bridge = _bridge_reanimated;
|
|
92
94
|
REAModule *reanimatedModule = [bridge moduleForClass:[REAModule class]];
|
|
93
95
|
|
|
94
96
|
auto propUpdater = [reanimatedModule](
|
|
@@ -111,6 +113,11 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<C
|
|
|
111
113
|
scrollTo(viewTag, uiManager, x, y, animated);
|
|
112
114
|
};
|
|
113
115
|
|
|
116
|
+
id<RNGestureHandlerStateManager> gestureHandlerStateManager = [bridge moduleForName:@"RNGestureHandlerModule"];
|
|
117
|
+
auto setGestureStateFunction = [gestureHandlerStateManager](int handlerTag, int newState) {
|
|
118
|
+
setGestureState(gestureHandlerStateManager, handlerTag, newState);
|
|
119
|
+
};
|
|
120
|
+
|
|
114
121
|
auto propObtainer = [reanimatedModule](
|
|
115
122
|
jsi::Runtime &rt, const int viewTag, const jsi::String &propName) -> jsi::Value {
|
|
116
123
|
NSString *propNameConverted = [NSString stringWithFormat:@"%s", propName.utf8(rt).c_str()];
|
|
@@ -223,6 +230,7 @@ std::shared_ptr<NativeReanimatedModule> createReanimatedModule(std::shared_ptr<C
|
|
|
223
230
|
scrollToFunction,
|
|
224
231
|
measuringFunction,
|
|
225
232
|
getCurrentTime,
|
|
233
|
+
setGestureStateFunction,
|
|
226
234
|
};
|
|
227
235
|
|
|
228
236
|
module = std::make_shared<NativeReanimatedModule>(
|
|
@@ -35,17 +35,21 @@ JSIExecutor::RuntimeInstaller REAJSIExecutorRuntimeInstaller(
|
|
|
35
35
|
[eventDispatcher setBridge:bridge];
|
|
36
36
|
#endif
|
|
37
37
|
[bridge updateModuleWithInstance:eventDispatcher];
|
|
38
|
-
_bridge_reanimated = bridge;
|
|
39
38
|
const auto runtimeInstaller = [bridge, runtimeInstallerToWrap](facebook::jsi::Runtime &runtime) {
|
|
40
39
|
if (!bridge) {
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
42
|
#if RNVERSION >= 63
|
|
44
|
-
auto reanimatedModule = reanimated::createReanimatedModule(bridge.jsCallInvoker);
|
|
43
|
+
auto reanimatedModule = reanimated::createReanimatedModule(bridge, bridge.jsCallInvoker);
|
|
45
44
|
#else
|
|
46
45
|
auto callInvoker = std::make_shared<react::BridgeJSCallInvoker>(bridge.reactInstance);
|
|
47
|
-
auto reanimatedModule = reanimated::createReanimatedModule(callInvoker);
|
|
46
|
+
auto reanimatedModule = reanimated::createReanimatedModule(bridge, callInvoker);
|
|
48
47
|
#endif
|
|
48
|
+
runtime.global().setProperty(
|
|
49
|
+
runtime,
|
|
50
|
+
"_WORKLET_RUNTIME",
|
|
51
|
+
static_cast<double>(reinterpret_cast<std::uintptr_t>(reanimatedModule->runtime.get())));
|
|
52
|
+
|
|
49
53
|
runtime.global().setProperty(
|
|
50
54
|
runtime,
|
|
51
55
|
jsi::PropNameID::forAscii(runtime, "__reanimatedModuleProxy"),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LogBox } from 'react-native';
|
|
2
|
+
import createAnimatedComponent from './createAnimatedComponent';
|
|
3
|
+
import {
|
|
4
|
+
addWhitelistedNativeProps,
|
|
5
|
+
addWhitelistedUIProps,
|
|
6
|
+
} from './ConfigHelper';
|
|
7
|
+
import * as reanimated1 from './reanimated1';
|
|
8
|
+
import ReanimatedComponents from './reanimated2/component';
|
|
9
|
+
|
|
10
|
+
const Animated = {
|
|
11
|
+
// components
|
|
12
|
+
...ReanimatedComponents,
|
|
13
|
+
createAnimatedComponent,
|
|
14
|
+
// configuration
|
|
15
|
+
addWhitelistedNativeProps,
|
|
16
|
+
addWhitelistedUIProps,
|
|
17
|
+
// reanimated 1
|
|
18
|
+
...reanimated1,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export * from './reanimated2';
|
|
22
|
+
export * from './reanimated1';
|
|
23
|
+
export default Animated;
|
|
24
|
+
|
|
25
|
+
// I think we can ignore this message as long as Gesture Handler doesn't
|
|
26
|
+
// try to load the Reanimated module. I figured it should be here instead of
|
|
27
|
+
// RNGH because this prevents the message from being displayed for all
|
|
28
|
+
// versions of RNGH.
|
|
29
|
+
LogBox.ignoreLogs([
|
|
30
|
+
'RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks',
|
|
31
|
+
]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -15,9 +15,9 @@ import './reanimated2/layoutReanimation/LayoutAnimationRepository';
|
|
|
15
15
|
import invariant from 'invariant';
|
|
16
16
|
import { adaptViewConfig } from './ConfigHelper';
|
|
17
17
|
import { RNRenderer } from './reanimated2/platform-specific/RNRenderer';
|
|
18
|
-
import { makeMutable, runOnUI } from './reanimated2/core';
|
|
18
|
+
import { makeMutable, runOnUI, enableLayoutAnimations, } from './reanimated2/core';
|
|
19
19
|
import { DefaultEntering, DefaultExiting, DefaultLayout, } from './reanimated2/layoutReanimation/defaultAnimations/Default';
|
|
20
|
-
import { isJest, isChromeDebugger } from './reanimated2/PlatformChecker';
|
|
20
|
+
import { isJest, isChromeDebugger, shouldBeUseWeb, } from './reanimated2/PlatformChecker';
|
|
21
21
|
import { initialUpdaterRun } from './reanimated2/animation';
|
|
22
22
|
const NODE_MAPPING = new Map();
|
|
23
23
|
function listener(data) {
|
|
@@ -58,6 +58,15 @@ function flattenArray(array) {
|
|
|
58
58
|
_flattenArray(array);
|
|
59
59
|
return resultArr;
|
|
60
60
|
}
|
|
61
|
+
function onlyAnimatedStyles(styles) {
|
|
62
|
+
return styles.filter((style) => style === null || style === void 0 ? void 0 : style.viewDescriptors);
|
|
63
|
+
}
|
|
64
|
+
function isSameAnimatedStyle(style1, style2) {
|
|
65
|
+
// We cannot use equality check to compare useAnimatedStyle outputs directly.
|
|
66
|
+
// Instead, we can compare its viewsRefs.
|
|
67
|
+
return (style1 === null || style1 === void 0 ? void 0 : style1.viewsRef) === (style2 === null || style2 === void 0 ? void 0 : style2.viewsRef);
|
|
68
|
+
}
|
|
69
|
+
const isSameAnimatedProps = isSameAnimatedStyle;
|
|
61
70
|
const has = (key, x) => {
|
|
62
71
|
if (typeof x === 'function' || typeof x === 'object') {
|
|
63
72
|
if (x === null || x === undefined) {
|
|
@@ -111,6 +120,9 @@ export default function createAnimatedComponent(Component, options) {
|
|
|
111
120
|
const tag = findNodeHandle(ref);
|
|
112
121
|
if ((this.props.layout || this.props.entering || this.props.exiting) &&
|
|
113
122
|
tag != null) {
|
|
123
|
+
if (!shouldBeUseWeb()) {
|
|
124
|
+
enableLayoutAnimations(true, false);
|
|
125
|
+
}
|
|
114
126
|
let layout = this.props.layout ? this.props.layout : DefaultLayout;
|
|
115
127
|
let entering = this.props.entering
|
|
116
128
|
? this.props.entering
|
|
@@ -213,9 +225,7 @@ export default function createAnimatedComponent(Component, options) {
|
|
|
213
225
|
}
|
|
214
226
|
else if (this._viewTag !== -1 && this._styles !== null) {
|
|
215
227
|
for (const style of this._styles) {
|
|
216
|
-
|
|
217
|
-
style.viewDescriptors.remove(this._viewTag);
|
|
218
|
-
}
|
|
228
|
+
style.viewDescriptors.remove(this._viewTag);
|
|
219
229
|
}
|
|
220
230
|
if ((_a = this.props.animatedProps) === null || _a === void 0 ? void 0 : _a.viewDescriptors) {
|
|
221
231
|
this.props.animatedProps.viewDescriptors.remove(this._viewTag);
|
|
@@ -309,8 +319,13 @@ export default function createAnimatedComponent(Component, options) {
|
|
|
309
319
|
}
|
|
310
320
|
_attachAnimatedStyles() {
|
|
311
321
|
var _a, _b, _c;
|
|
312
|
-
const styles =
|
|
322
|
+
const styles = this.props.style
|
|
323
|
+
? onlyAnimatedStyles(flattenArray(this.props.style))
|
|
324
|
+
: [];
|
|
325
|
+
const prevStyles = this._styles;
|
|
313
326
|
this._styles = styles;
|
|
327
|
+
const prevAnimatedProps = this._animatedProps;
|
|
328
|
+
this._animatedProps = this.props.animatedProps;
|
|
314
329
|
let viewTag;
|
|
315
330
|
let viewName;
|
|
316
331
|
if (Platform.OS === 'web') {
|
|
@@ -329,30 +344,48 @@ export default function createAnimatedComponent(Component, options) {
|
|
|
329
344
|
* RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollViewViewConfig.js#L16).
|
|
330
345
|
* The name we're looking for is in the field named uiViewClassName.
|
|
331
346
|
*/
|
|
332
|
-
viewName = (
|
|
347
|
+
viewName = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.viewConfig) === null || _a === void 0 ? void 0 : _a.uiViewClassName;
|
|
333
348
|
// update UI props whitelist for this view
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
hostInstance.viewConfig) {
|
|
349
|
+
const hasReanimated2Props = ((_b = this.props.animatedProps) === null || _b === void 0 ? void 0 : _b.viewDescriptors) || styles.length;
|
|
350
|
+
if (hasReanimated2Props && (hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.viewConfig)) {
|
|
337
351
|
adaptViewConfig(hostInstance.viewConfig);
|
|
338
352
|
}
|
|
339
353
|
}
|
|
340
354
|
this._viewTag = viewTag;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
355
|
+
// remove old styles
|
|
356
|
+
if (prevStyles) {
|
|
357
|
+
// in most of the cases, views have only a single animated style and it remains unchanged
|
|
358
|
+
const hasOneSameStyle = styles.length === 1 &&
|
|
359
|
+
prevStyles.length === 1 &&
|
|
360
|
+
isSameAnimatedStyle(styles[0], prevStyles[0]);
|
|
361
|
+
if (!hasOneSameStyle) {
|
|
362
|
+
// otherwise, remove each style that is not present in new styles
|
|
363
|
+
for (const prevStyle of prevStyles) {
|
|
364
|
+
const isPresent = styles.some((style) => isSameAnimatedStyle(style, prevStyle));
|
|
365
|
+
if (!isPresent) {
|
|
366
|
+
prevStyle.viewDescriptors.remove(viewTag);
|
|
367
|
+
}
|
|
353
368
|
}
|
|
354
369
|
}
|
|
370
|
+
}
|
|
371
|
+
styles.forEach((style) => {
|
|
372
|
+
style.viewDescriptors.add({ tag: viewTag, name: viewName });
|
|
373
|
+
if (isJest()) {
|
|
374
|
+
/**
|
|
375
|
+
* We need to connect Jest's TestObject instance whose contains just props object
|
|
376
|
+
* with the updateProps() function where we update the properties of the component.
|
|
377
|
+
* We can't update props object directly because TestObject contains a copy of props - look at render function:
|
|
378
|
+
* const props = this._filterNonAnimatedProps(this.props);
|
|
379
|
+
*/
|
|
380
|
+
this.animatedStyle.value = Object.assign(Object.assign({}, this.animatedStyle.value), style.initial.value);
|
|
381
|
+
style.animatedStyle.current = this.animatedStyle;
|
|
382
|
+
}
|
|
355
383
|
});
|
|
384
|
+
// detach old animatedProps
|
|
385
|
+
if (prevAnimatedProps &&
|
|
386
|
+
!isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)) {
|
|
387
|
+
prevAnimatedProps.viewDescriptors.remove(viewTag);
|
|
388
|
+
}
|
|
356
389
|
// attach animatedProps property
|
|
357
390
|
if ((_c = this.props.animatedProps) === null || _c === void 0 ? void 0 : _c.viewDescriptors) {
|
|
358
391
|
this.props.animatedProps.viewDescriptors.add({
|
|
@@ -363,21 +396,6 @@ export default function createAnimatedComponent(Component, options) {
|
|
|
363
396
|
});
|
|
364
397
|
}
|
|
365
398
|
}
|
|
366
|
-
_hasReanimated2Props(flattenStyles) {
|
|
367
|
-
var _a;
|
|
368
|
-
if ((_a = this.props.animatedProps) === null || _a === void 0 ? void 0 : _a.viewDescriptors) {
|
|
369
|
-
return true;
|
|
370
|
-
}
|
|
371
|
-
if (this.props.style) {
|
|
372
|
-
for (const style of flattenStyles) {
|
|
373
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
374
|
-
if (style === null || style === void 0 ? void 0 : style.hasOwnProperty('viewDescriptors')) {
|
|
375
|
-
return true;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
return false;
|
|
380
|
-
}
|
|
381
399
|
_detachPropUpdater() {
|
|
382
400
|
const viewTag = findNodeHandle(this);
|
|
383
401
|
NODE_MAPPING.delete(viewTag);
|
package/lib/src/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LogBox } from 'react-native';
|
|
2
|
+
import createAnimatedComponent from './createAnimatedComponent';
|
|
3
|
+
import {
|
|
4
|
+
addWhitelistedNativeProps,
|
|
5
|
+
addWhitelistedUIProps,
|
|
6
|
+
} from './ConfigHelper';
|
|
7
|
+
import * as reanimated1 from './reanimated1';
|
|
8
|
+
import ReanimatedComponents from './reanimated2/component';
|
|
9
|
+
|
|
10
|
+
const Animated = {
|
|
11
|
+
// components
|
|
12
|
+
...ReanimatedComponents,
|
|
13
|
+
createAnimatedComponent,
|
|
14
|
+
// configuration
|
|
15
|
+
addWhitelistedNativeProps,
|
|
16
|
+
addWhitelistedUIProps,
|
|
17
|
+
// reanimated 1
|
|
18
|
+
...reanimated1,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export * from './reanimated2';
|
|
22
|
+
export * from './reanimated1';
|
|
23
|
+
export default Animated;
|
|
24
|
+
|
|
25
|
+
// I think we can ignore this message as long as Gesture Handler doesn't
|
|
26
|
+
// try to load the Reanimated module. I figured it should be here instead of
|
|
27
|
+
// RNGH because this prevents the message from being displayed for all
|
|
28
|
+
// versions of RNGH.
|
|
29
|
+
LogBox.ignoreLogs([
|
|
30
|
+
'RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks',
|
|
31
|
+
]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|