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

141
Views
Mostrar la rueda giratoria de carga mientras se obtienen los datos

¿Cómo se puede mostrar una rueda de carga mientras se cargan los datos para buscar?

 const [user, loading, error] = useAuthState(auth); const navigate = useNavigate() const [bikes] = useBikes() if (loading) { return <Loading></Loading> } fetch(`http://localhost:5000/bike/${id}`, { method: 'DELETE' }) .then(res => res.json()) .then(data => { console.log(data) alert('One Item Deleted') });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Si tiene la rueda debajo de la spinner de identificación, aquí hay un ejemplo minimalista de cómo puede hacerlo. simplemente envuelva la búsqueda dentro de una función.

 function delitem(){ document.getElementByID("spinner").style.display = "block" fetch(`http://localhost:5000/bike/${id}`, { method: 'DELETE' }) .then(res => res.json()) .then(data => { console.log(data) alert('One Item Deleted') document.getElementByID("spinner").style.display = "none" }); }

about 4 years ago · Juan Pablo Isaza Report

0

Ponga su API de búsqueda dentro de useEffect, para que pueda implementar fácilmente su funcionalidad de spinner

 const [isLoading,setIsLoading]=useState(false); useEffect(()=>{ setIsLoading(true); fetch("some-url").then(res=>res.json()) .then(data=>{ setIsLoading(false) console.log(data); },[]) if(isLoading){ return <LoadingSpinner/> } return <div>..your data </div>
about 4 years ago · Juan Pablo Isaza Report
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!