0.1.0 • Published 4 years ago

use-image-load v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

try to use custom hook as an easy example.

Example

import useImageLoad from 'use-image-load';

const { img, status } = useImageLoad('url')

The img only have value when load success, useImageLoad can return these status:

export enum LoadingStatus {
  LOADING = 'LOADING',
  SUCCESS = 'SUCCUESS',
  FAIL = 'FAIL'
}