diff --git a/lib/ImageWorker.js b/lib/ImageWorker.js index 743e1c9..2a0ed6d 100644 --- a/lib/ImageWorker.js +++ b/lib/ImageWorker.js @@ -20,8 +20,7 @@ type ImageWorkerProps = { src: string, placeholder?: string | Function, style?: Object, - imageClass?: string, - containerClass?: string, + placeholderAlt?: string } type ImageWorkerState = { @@ -64,12 +63,12 @@ class ImageWorker extends Component { } renderPlaceholder() { - const { placeholder, style } = this.props; + const { placeholder, style, placeholderAlt } = this.props; if (typeof placeholder === 'function') { const PlaceholderComponent = wrappedComponent(placeholder); return ; } else if (typeof placeholder === 'string') { - return placeholder; + return {placeholderAlt}; } else { return null; } @@ -90,16 +89,11 @@ class ImageWorker extends Component { } render() { - const { style, imageClass, containerClass } = this.props; - return ( -
- { - this.state.isLoading ? this.renderPlaceholder() : - worker - } -
- ); + const { style, src, placeholderAlt, placeholder, ...props } = this.props; // eslint-disable-line no-unused-vars + const { isLoading, imgSrc } = this.state; + return isLoading ? this.renderPlaceholder() : + ; } }