import React, { PureComponent } from 'react';
import { Animated, View } from 'react-native';
export class FadeInImage extends PureComponent {
    constructor(props) {
        super(props);
        this.setNativeProps = (props) => {
            if (this.view.current) {
                this.view.current.setNativeProps(props);
            }
        };
        this.onLoad = () => {
            Animated.timing(this.state.opacity, {
                toValue: 1,
                duration: 250,
                useNativeDriver: true
            }).start();
        };
        this.view = React.createRef();
        this.state = {
            opacity: new Animated.Value(0)
        };
    }
    render() {
        const { style, resizeMode = 'contain', resizeMethod = 'resize', source } = this.props;
        return (<View ref={this.view}>
        <Animated.Image source={source} style={[{ opacity: this.state.opacity }, style]} resizeMode={resizeMode} resizeMethod={resizeMethod} onLoad={this.onLoad}/>
      </View>);
    }
}
//# sourceMappingURL=FadeInImage.js.map