Reputation: 2815
Is it possible to pass the click event from the parent to the child? So when Button
is clicked FileUpload
is clicked too. My working code is here.
https://codesandbox.io/s/uploadbutton-78h2d
<Button>
<Dialog>
<FileUpload/>
</Dialog>
</Button>
Upvotes: 1
Views: 53
Reputation: 1592
Simply have the onClick
event listener on the Button instead of the FileUpload (or have it on both but make sure you're stopping propagation so it doesn't double-fire the event.
Upvotes: 1