Disabled drop-zone

Viewed 55

I'm using react-dropzone in my project and I set a limit of files, but if I drag any image to the drop zone, the image wait in the browser storage. the clickzone is disable, but I still can drag some images

I need to disable the dropzone when the limit is reached

{allowUpload && files.length < limitFiles &&
            <div className="file-grid__instructions">
                {isDragActive
                    ? <p>Drop here...</p>
                    : <p>drag or click to upload</p>
                }
            </div>
        }{allowUpload && files.length >= limitFiles &&
            <div className="file-grid__instructions">
                {isDragActive
                    ? <p></p>
                    : <p>The limit ...</p>
                }
            </div>
        }
0 Answers
Related