drag and drop file validation react code example
Example 1: drag n drop file upload react
const onFileInputChange = (event) => {
const { files } = event.target;
// do something with your files...
}
Example 2: drag n drop file upload react
<input
onChange={onFileInputChange}
ref={fileInputRef}
type="file"
className="hidden"
/>