<Input
id="image"
type="file"
accept="image/*"
onChange={(event) =>
getBase64(event.target.files[0])
.then((file) => this.setState({ image: file })
)}
/>
But it does accept other files too, what should I change to make it accept only images?
<input>
element, not<Input>
- you must be using some library that ignores theaccept
prop. Which library are you using? – Entomology