1.0.7 • Published 2 years ago

legendary-image-preview v1.0.7

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

image-preview-npm

An image preview package published live on npm

install

npm i image-preview-npm

Initialize the image object

   import Image from 'legendary-image-preview';

 
   //use the image's getBase64Image function in your handler to get the base64 image and set it as the source of the img tag like so:\
   function ImagePreview(){
    const  [imageSource,setImageSource] = useState('');
    const  handleChange = (e) => {
    let image  = new Image(e.target.files);
    setImageSource(image.getBase64Image());
 }
 return(
 <div>
      <input onChange={handleChange} type='file'/>
      <img src={image} alt='preview' />
     </div>
 )
 }
 export default ImagePreview;
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago