import Knocking from './knocking' import React from 'react' class Image extends React.Component { constructor(props) { super(props) this.onLoad = this.onLoad.bind(this) this.state = { isLoading: true, } } componentWillReceiveProps(nextProps) { if (this.props.src !== nextProps.src) { this.setState({ isLoading: true, }) } } onLoad() { this.setState({ isLoading: false, }) } render() { const { isLoading } = this.state const { text, src, style, styleLoading, styleWrapper } = this.props return (