title: How to pass multiple videos button onclick event in react
body: <p>call API using <code>fetch</code> and get response in console and assign values to table header.
  after that creating one button in react js. Each button have one video URL which is got from API response</p>
  <p>API response:</p>
  <pre><code>Camera_Number:&quot;Camera_1&quot;
  Group_Name: &quot;Group_1&quot;
  Video_Name: &quot;http://localhost:4000/video/0&quot;
  
  Camera_Number:&quot;Camera_2&quot;
  Group_Name: &quot;Group_2&quot;
  Video_Name: &quot;http://localhost:4000/video/1&quot;
  </code></pre>
  <p>I stored this response in <code>useState</code> and pass this usestate response to video player source</p>
  <pre><code>        const actionButton = (params) =&gt; {
          setVideoName(response.videoName); //  How to update videoName here
          setOpen(true);
          };
  
          const [videoName, setVideoName] = useState([]);
          const [response, setResponse] = useState([]);
  
          headerName: &quot;Actions&quot;,
          field: &quot;Video_Name&quot;,
          cellRendererFramework: (params) =&gt; (
            &lt;div&gt;
              &lt;Button
                variant=&quot;contained&quot;
                onClick={() =&gt; actionButton(params)}
              &gt;
                Play
              &lt;/Button&gt;
            &lt;/div&gt;
  </code></pre>
  <p>Above code shows assign video_name to <code>Actions</code> header then I created one button. when I click one button, all of the videos open in one window and play all videos. But  I want it so that only that certain video that was clicked would show.</p>
  <pre><code> &lt;DialogContent&gt;
              {response.map(({ Video_Name }) =&gt; (
                &lt;iframe
                  width=&quot;420&quot;
                  height=&quot;315&quot;
                  title=&quot;videos&quot;
                  src={Video_Name}
                /&gt;
              ))}
            &lt;/DialogContent&gt;
  </code></pre>
  <p>How to resolve this issue using react-hooks.</p>
  <p>for more details and code reference</p>
  <blockquote>
  <p><a href="https://github.com/iamharry-dev/modal_popup" rel="nofollow noreferrer">https://github.com/iamharry-dev/modal_popup</a></p>
  </blockquote>
  <p>how to create index for video and pass videos to video player source. when i click that button certain video that was clicked would show.</p>
  <p>Thanks</p>