File tree 2 files changed +64
-1
lines changed
2 files changed +64
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const {
17
17
Platform,
18
18
processColor,
19
19
} = require ( 'react-native' ) ;
20
+ const ReanimatedV2 = require ( './src/reanimated2/mock' ) ;
20
21
21
22
function NOOP ( ) { }
22
23
@@ -234,7 +235,10 @@ module.exports = {
234
235
235
236
...Reanimated ,
236
237
237
- default : Reanimated ,
238
+ default : {
239
+ ...Reanimated ,
240
+ ...ReanimatedV2 ,
241
+ } ,
238
242
239
243
Transitioning : {
240
244
View : createTransitioningComponent ( View ) ,
Original file line number Diff line number Diff line change
1
+ /* eslint-disable standard/no-callback-literal */
2
+ const NOOP = ( ) => { } ;
3
+ const ID = ( t ) => t ;
4
+
5
+ const ReanimatedV2 = {
6
+ useSharedValue : ( value ) => ( { value } ) ,
7
+ useDerivedValue : ( a ) => ( { value : a ( ) } ) ,
8
+ useAnimatedScrollHandler : ( ) => NOOP ,
9
+ useAnimatedGestureHandler : ( ) => NOOP ,
10
+ useAnimatedStyle : ( style ) => style ,
11
+ useAnimatedRef : ( ) => ( { current : null } ) ,
12
+ useAnimatedReaction : NOOP ,
13
+
14
+ withTiming : ( toValue , _ , cb ) => {
15
+ cb && setTimeout ( ( ) => cb ( true ) , 0 ) ;
16
+ return toValue ;
17
+ } ,
18
+ withSpring : ( toValue , _ , cb ) => {
19
+ cb && setTimeout ( ( ) => cb ( true ) , 0 ) ;
20
+ return toValue ;
21
+ } ,
22
+ withDecay : ( _ , cb ) => {
23
+ cb && setTimeout ( ( ) => cb ( true ) , 0 ) ;
24
+ return 0 ;
25
+ } ,
26
+ cancelAnimation : NOOP ,
27
+ delay : ( _ , b ) => b ,
28
+ sequence : ( ) => 0 ,
29
+ repeat : ( a ) => a ,
30
+ measure : ( ) => ( {
31
+ x : 0 ,
32
+ y : 0 ,
33
+ width : 0 ,
34
+ height : 0 ,
35
+ pageX : 0 ,
36
+ pageY : 0 ,
37
+ } ) ,
38
+ Easing : {
39
+ linear : ID ,
40
+ ease : ID ,
41
+ quad : ID ,
42
+ cubic : ID ,
43
+ poly : ID ,
44
+ sin : ID ,
45
+ circle : ID ,
46
+ exp : ID ,
47
+ elastic : ID ,
48
+ back : ID ,
49
+ bounce : ID ,
50
+ bezier : ID ,
51
+ in : ID ,
52
+ out : ID ,
53
+ inOut : ID ,
54
+ } ,
55
+ } ;
56
+
57
+ module . exports = {
58
+ ...ReanimatedV2 ,
59
+ } ;
You can’t perform that action at this time.
0 commit comments