I have a form ingesting some strings and a file. The strings are working correctly, but whenever I check to see if the file has been registered correctly, it's always null.
The interface I'm using:
export interface myDetail {
myText: string;
Picture?: File;
}
Form group for image (not working):
<Form
onSubmit={handleSubmit((data) => {
console.log(data);
setDetail({ ...myDetail, ...data });
})}
>
<Form.Group controlId="formFile" className="mb-3">
<Form.Label>Upload Picture</Form.Label>
<Form.Control as="input" type="file" {...register('Picture')} />
</Form.Group>
button:
<AsyncButton type="submit">Save</AsyncButton>
The string variables get assigned fine, but when I check data, the Picture is set to "0, {}"
Thanks for any help