Last active
December 4, 2017 19:39
-
-
Save perjansson/56a85d0f9ac4221aef9bd512dca8a845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Render function of ProgressiveImage | |
| render() { | |
| return this.props.render(loading) | |
| } | |
| // Usage | |
| render() { | |
| return ( | |
| <ProgressiveImage | |
| render={(src, loading) => ( | |
| <img src={src} style={{ filter: loading ? 'grayscale(0.5) blur(50px)' : '' }} /> | |
| )} | |
| /> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment