score:1

an example of how it can be done in react in this working repl.

import react from 'react';
import './app.css';

class app extends react.component {
  constructor(props) {
    super(props);

    this.inputref = react.createref();

    this.onbrowseclick = this.onbrowseclick.bind(this);
  }

  componentdidmount() {
    
  }

  onbrowseclick = () => {
    this.inputref.current.click();
  };

  render() {
    return (
      <div>
        <input type="file" style={{display: 'none'}} ref={this.inputref}></input>
        <button onclick={this.onbrowseclick}>browse</button>
      </div>
    );
  }
}

export default app;

Related Query

More Query from same tag