1.1.0 • Published 2 years ago

use-file-dialog v1.1.0

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

React useFileDialog hook

NPM

Open file dialog without struggling with file input using useFileDialog react hook.

Install

You can install use-file-dialog with NPM or Yarn.

npm install use-file-dialog
yarn add use-file-dialog

Usage

Here's how to use use-file-dialog:

import useFileDialog from "use-file-dialog";

function App() {
  const { files, openFileDialog } = useFileDialog();

  console.log(files);

  return (
    <button type='button' onClick={openFileDialog}>Choose file</button>
  );
}