1.0.3 • Published 3 years ago

react-image-to-file v1.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

react-image-to-file

Allows react web dev implementing the functionality of downloading an image by clicking on a button ( Hooks only )

NPM JavaScript Style Guide

Install

npm install --save react-image-to-file

Usage

import React from 'react'
import { useDownloadImg } from 'react-image-to-file'

const App = () => {
  const downloadImg = useDownloadImg()

  const onDownloadImg = () => {
    downloadImg({elementID: "my-image", fileName: "my-image"})
  }
  
  return (
    <div>
      <img
        id="my-image"
        alt='Your own'
        src='https://source.unsplash.com/random'
      />
      <button onClick={onDownloadImg}>download img</button>
    </div>
  )
}

export default App

License

MIT © hkhattabi

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago