Simple hidden file input handler
const AddImage = () => {
const file = useFileInput({
onUpload: (file) => {
console.log('Uploading file...', file)
},
inputProps: {
accept: "image/*",
},
})
return (
<button onClick={file.handleClick}>
{file.input}
Add image
</button>
)
};