React-dropzone does not submit the files in form submissions by default. If you need this behavior, you can add a hidden file input, and set the files into it. ```jsx harmony import React, {useRef} from 'react'; import {useDropzone} from 'react-dropzone'; function Dropzone(props) { const {required, name} = props; const hiddenInputRef = useRef(null); const {getRootProps, getInputProps, open, acceptedFiles} = useDropzone({ onDrop: (incomingFiles) => { if (hiddenInputRef.current) { // Note the specific way we need to munge the file into the hidden input // https://stackoverflow.com/a/68182158/1068446 const dataTransfer = new DataTransfer(); incomingFiles.forEach((v) => { dataTransfer.items.add(v); }); hiddenInputRef.current.files = dataTransfer.files; } } }); const files = acceptedFiles.map(file => (
  • {file.path} - {file.size} bytes
  • )); return (
    {/* Add a hidden file input Best to use opacity 0, so that the required validation message will appear on form submission */}

    Drag 'n' drop some files here

    ); }
    { e.preventDefault(); // Now get the form data as you regularly would const formData = new FormData(e.currentTarget); const file = formData.get("my-file"); alert(file.name); }}> ```