React Hooks for file selection
npm install use-file-inputReact Hooks for selecting files with hidden
``sh`
npm install --save use-file-inputor
yarn add use-file-input
`jsx
const Component = () => {
const handleFileSelect = useFileInput(
(files) => {
// files is FileList
// do something with selected files
},
{ accept: "image/*", multiple: true }
);
return (
);
};
``
MIT License