Skip to content

Instantly share code, notes, and snippets.

@perjansson
Last active December 4, 2017 19:39
Show Gist options
  • Save perjansson/56a85d0f9ac4221aef9bd512dca8a845 to your computer and use it in GitHub Desktop.
Save perjansson/56a85d0f9ac4221aef9bd512dca8a845 to your computer and use it in GitHub Desktop.
// 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