react-file-input
react-file-input copied to clipboard
Clear selected value
Hi there!
How can I clear seleted value? I'm tried to set
value={this.state.image}
and then to set it to null, but it doesnt work.
You can do this explicitly like this without React:
document.getElementsByName("myImage")[0].value = ""
it's better to do
uploadHandler(event) {
if (error) event.target.value = '';
}
I guess.