title: How to set srcObject for a videotag in React while rendering?
body: <p>I have a piece of code as such :</p>
  <pre><code>  function VideoRender() {
      const pRef = React.useRef()
      return incData.map((el, i) =&gt; {
        return (
          &lt;div key={i}&gt;
            &lt;video ref={pRef} autoPlay&gt;&lt;/video&gt;
          &lt;/div&gt;
        )
      })
    }
  </code></pre>
  <p>I want to set <code>mediaStream</code> to the video tag right in the <code>map</code> function but apparently I run into errors. What is the proper way of rendering <code>&lt;video&gt;</code> and changing the <code>mediaStream</code> through <code>srcObject</code> in React?</p>