Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Estoy creando la publicación de Facebook en reaccionar. y ya casi termino, pero tengo problemas para averiguar cómo cerrar el gif seleccionado en el área de texto

Quiero cerrar el gif que se muestra en el área de texto haciendo clic en el botón de cerrar; si lo hago, no podré volver a obtener los datos del gif. entonces quiero seleccionar el gif cada vez que cierro el gif sin actualizar.

 import axios from "axios"; import { useState } from "react"; import { useEffect } from "react"; import "./componentsStyles/GifInText.css" const GifInText = ({gifId}) => { const [post, setPost] = useState({}); const [closeGif, setCloseGif] = useState(false) const fetchData = async () =>{ await axios.get(`https://api.giphy.com/v1/gifs/${gifId}`,{ params: { api_key: "Xoa3mXrWxKXw6lJscrKUTsbZsXLbGuGY", gif_id: gifId } }).catch((error) =>{ console.log("error at fetching gifID2", error); }).then(response => { setPost(response.data) }); } useEffect(()=>{ fetchData() }, [ ]) return ( <div className='gif-section'> {post.data && ( <> <div className='image-gifs'> <i className="fas fa-times" onClick={()=>setCloseGif(!post)}></i> <img className="live-gifs" src={post.data.images.fixed_height.url} alt="..."/> </div> </> )} </div> ) } export default GifInText;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!