title: How do i can close the selected Gif and once i close the Gif i can able to get other Gif?
body: <p>am creating facebook post page for my project, and almost done, but am not getting how to close the selected gif and once i close the selected gif am not able to get other gif. If any knows please help.</p>
  <pre><code>import axios from &quot;axios&quot;;
  import { useState } from &quot;react&quot;;
  import { useEffect } from &quot;react&quot;;
  import &quot;./componentsStyles/GifInText.css&quot;
   
  const GifInText = ({gifId}) =&gt; {
  
      const [post, setPost] = useState({});
      const [closeGif, setCloseGif] = useState(false)
       
  
      const fetchData = async () =&gt;{
            await axios.get(`https://api.giphy.com/v1/gifs/${gifId}`,{
                  params: { 
                      api_key: &quot;Xoa3mXrWxKXw6lJscrKUTsbZsXLbGuGY&quot;,
                      gif_id: gifId
                  }
              }).catch((error) =&gt;{
                  console.log(&quot;error at fetching gifID2&quot;, error);
                }).then(response =&gt; {
                  setPost(response.data)
                 
                });
              }
      useEffect(()=&gt;{
          fetchData()
          }, [  ])
  
          
  
          return (
              &lt;div className='gif-section'&gt;   
              {post.data &amp;&amp; (
                      &lt;&gt;
                      &lt;div className='image-gifs'&gt;
                       &lt;i className=&quot;fas fa-times&quot; onClick={()=&gt;setCloseGif(!post)}&gt;&lt;/i&gt;
                       &lt;img className=&quot;live-gifs&quot; src={post.data.images.fixed_height.url} alt=&quot;...&quot;/&gt;
                      &lt;/div&gt;
                      &lt;/&gt;
                  )}
              &lt;/div&gt; 
           )
  }
  export default GifInText;
  </code></pre>