File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ class Animation {
57
57
}
58
58
__startNativeAnimation ( animatedValue : AnimatedValue ) : void {
59
59
animatedValue . __makeNative ( ) ;
60
+ animatedValue . __connectAnimatedNodes ( ) ;
60
61
this . __nativeId = NativeAnimatedHelper . generateNewAnimationId ( ) ;
61
62
NativeAnimatedHelper . API . startAnimatingNode (
62
63
this . __nativeId ,
Original file line number Diff line number Diff line change @@ -35,12 +35,18 @@ class AnimatedNode {
35
35
36
36
/* Methods and props used by native Animated impl */
37
37
__isNative : boolean ;
38
+ __isConnected : boolean ;
38
39
__nativeTag : ?number ;
39
40
__makeNative ( ) {
40
41
if ( ! this . __isNative ) {
41
42
throw new Error ( 'This node cannot be made a "native" animated node' ) ;
42
43
}
43
44
}
45
+ __connectAnimatedNodes ( ) {
46
+ if ( ! this . __isNative ) {
47
+ throw new Error ( 'This node cannot be connected natively' ) ;
48
+ }
49
+ }
44
50
__getNativeTag ( ) : ?number {
45
51
NativeAnimatedHelper . assertNativeAnimatedModule ( ) ;
46
52
invariant (
@@ -49,11 +55,11 @@ class AnimatedNode {
49
55
) ;
50
56
if ( this . __nativeTag == null ) {
51
57
const nativeTag : ?number = NativeAnimatedHelper . generateNewNodeTag ( ) ;
58
+ this . __nativeTag = nativeTag ;
52
59
NativeAnimatedHelper . API . createAnimatedNode (
53
60
nativeTag ,
54
61
this . __getNativeConfig ( ) ,
55
62
) ;
56
- this . __nativeTag = nativeTag ;
57
63
}
58
64
return this . __nativeTag ;
59
65
}
Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ class AnimatedWithChildren extends AnimatedNode {
25
25
this . __isNative = true ;
26
26
for ( const child of this . _children ) {
27
27
child . __makeNative ( ) ;
28
+ }
29
+ }
30
+ }
31
+
32
+ __connectAnimatedNodes ( ) {
33
+ if ( ! this . __isConnected ) {
34
+ this . __isConnected = true ;
35
+ for ( const child of this . _children ) {
36
+ child . __connectAnimatedNodes ( ) ;
28
37
NativeAnimatedHelper . API . connectAnimatedNodes (
29
38
this . __getNativeTag ( ) ,
30
39
child . __getNativeTag ( ) ,
You can’t perform that action at this time.
0 commit comments