I am using Upload component in Ant Design to upload files but I have a problem with upload manually. I want to replace the <Button />
upload by auto trigger start uploading if the file was selected from <Upload />
return (
<div style={{ padding: '20px' }}>
<Upload {...props}>
<Button icon={<UploadOutlined />}>
Select File
</Button>
</Upload>
// The button upload below not needed for me, so i need to remove it,
however I need <Upload /> also works without this Button
<Button
type="primary"
onClick={handleUpload}
disabled={fileList.length === 0}
loading={uploading}
style={{ marginTop: 16 }}
>
{uploading ? 'Uploading' : 'Start Upload'}
</Button>
</div>
);
Here's my full code on Stackblitz: https://stackblitz.com/edit/react-w1pc9r?file=src/App.js