React Image onLoad event.
This is a workaround foronLoad
event not being triggered in SSR case.
$ yarn add react-image-onload
import ImageOnLoad from 'react-image-onload';
<ImageOnLoad
onLoad={({ width, height }: HTMLImageElement) => {}}
src="image"
alt="background image"
/>;
type Props = {
src: string,
onLoad: (image: HTMLImageElement) => Promise<void> | void,
};
- node >= 9.8.0
- yarn >= 1.5.1
$ yarn install --pure-lockfile
$ yarn start
$ yarn run format
$ yarn run eslint
$ yarn run flow
$ yarn run test:watch
$ yarn run build
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests.