Closed chicagocomputerclasses closed 1 year ago
How can we assign an event when the little (x) clear button is pressed to clear the file input?
I suppose we can just useEffect and react when file input changes, but it would be nice to have a cleaner way like <MuiFileInput onClear={ () => {} } />
<MuiFileInput onClear={ () => {} } />
Hello @chicagocomputerclasses !
What about this ?
const handleChange = (newValue: File[]) => { if (newValue.length === 0) { // clear ? } }
How can we assign an event when the little (x) clear button is pressed to clear the file input?
I suppose we can just useEffect and react when file input changes, but it would be nice to have a cleaner way like
<MuiFileInput onClear={ () => {} } />