Closed marcusflat closed 1 year ago
Issue has been fixed in v2.0.4
, the typing was wrong in the code, not in the documentation.
onChange
(value: File | null) => void
multiple
is present: (value: File[]) => void
Gets called once the user updates the file value.
Example:
const handleChange = (value) => {}
<MuiFileInput onChange={handleChange} />
Thanks for the catch @marcusflat
On typescript section, the type of useState and handleChange newValue param is missing
File[]
;I got the error: Type '(newValue: File | null) => void' is not assignable to type '(value: File | File[] | null) => void'.
The correct type is:
File | File[] | null
Doc Page