File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/components/animatedImage Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
// TODO: consider unify this component functionality with our Image component
2
+ import _ from 'lodash' ;
2
3
import PropTypes from 'prop-types' ;
3
4
import React from 'react' ;
4
5
import { Animated , View , StyleSheet } from 'react-native' ;
@@ -43,11 +44,12 @@ class AnimatedImage extends BaseComponent {
43
44
this . state = { opacity : new Animated . Value ( 0 ) , isLoading : true } ;
44
45
}
45
46
46
- onLoad = ( ) => {
47
+ onLoad = ( ... args ) => {
47
48
this . setState ( { isLoading : false } , ( ) => {
48
49
const animationParams = { toValue : 1 , duration : this . props . animationDuration , useNativeDriver : true } ;
49
50
Animated . timing ( this . state . opacity , animationParams ) . start ( ) ;
50
51
} ) ;
52
+ _ . invoke ( this . props , 'onLoad' , ...args ) ;
51
53
} ;
52
54
53
55
render ( ) {
@@ -58,7 +60,7 @@ class AnimatedImage extends BaseComponent {
58
60
{ ...others }
59
61
style = { [ { opacity : this . state . opacity } , style ] }
60
62
source = { source }
61
- onLoad = { ( ) => this . onLoad ( ) }
63
+ onLoad = { this . onLoad }
62
64
testID = { testID }
63
65
/>
64
66
{ this . state . isLoading && loader && (
You can’t perform that action at this time.
0 commit comments