I've got a file selector, when clicking the button, the file selector shows up:
<input id='example' type="file" accept="image/*" onChange={this.onImageChange} />
Now I want to use another button to do that, trigger the input above :
<button onClick={() => {
    var element = document.getElementById('example');
    console.log(element) // This shows <input id="example" type="file" accept="image/*">
    // element.onChange() // Error: onChange() is not a function
    // Above doesn't work, so I try to trigger the onChange event manually,
    // but below doesn't do anything
    var event = new Event('change');
    element.dispatchEvent(event);
}}></button>
 
     
     
    