title: How to access files in React
body: <p>So in HTML I can do something this:</p>
  
  <pre><code>&lt;input type="file" id="upload" accept="text" multiple/&gt;
  </code></pre>
  
  <p>Then I can access the files uploaded in JavaScript like this whenever the input changes:</p>
  
  <pre><code>document.getElementById('upload').onchange = function(){
    const uFiles = this.files;
    console.log(uFiles);
  }
  </code></pre>
  
  <p>How would I go about doing that with ReactJS? So far, I've tried using the same approach I would use for HTML and JavaScript but I get the response that uFiles is undefined rather than a FileList object.</p>
  
  <hr>
  
  <p>In my React Render:</p>
  
  <pre><code>&lt;input onChange={this.doFunc} id="upload" type="file" accept="text" multiple /&gt;
  </code></pre>
  
  <p>In my React class:</p>
  
  <pre><code>doFunc = () =&gt; {
  
    const uFiles = this.files;
    console.log(uFiles);
  
  }
  </code></pre>