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

285
Views
Cómo iniciar el temporizador de cuenta regresiva en el momento js React

Soy nuevo en esto de usar moment js, tomé esta muestra de Internet y la modifiqué de acuerdo a mi manera, aquí quiero que la cuenta regresiva comience desde 2 min: 00 seg hasta las 00:00.

 import React, { useEffect, useState } from "react"; import moment from "moment"; export default function CountdownMonths(){ const [currentTime, setCurrentTime] = useState(moment()); const timeBetween = moment.duration({ "minutes": 2, "seconds":"00" }); useEffect(() => { const interval = setInterval(() => { setCurrentTime(moment()); }, 1000); return () => clearInterval(interval); }, []); return ( <> <p>Deadline comes in</p> <p className="counter"> <span>{timeBetween.minutes()}m: </span> <span>{timeBetween.seconds()}s </span> </p> </> ); };

¿Cómo debo comenzar la cuenta regresiva en el procesamiento de la página? Cualquier ayuda sería muy apreciada.

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!