1functionThatResetsTheFileInput() {
2 let randomString = Math.random().toString(36);
3
4 this.setState({
5 theInputKey: randomString
6 });
7}
8
9render() {
10 return(
11 <div>
12 <input type="file"
13 key={this.state.theInputKey || '' } />
14 <button onClick={this.functionThatResetsTheFileInput()} />
15 </div>
16 )
17}
18