title: How to display countdown timer in React
body: <p>How can I show countdown timer in minute and seconds. right now I am able to show the timer in seconds, only but I want to display both minutes and seconds both.</p>
  
  <p>Currently my countdown timer is showing in this way <code>Countdown: 112</code> but I want it to be like <code>Countdown: 1: 52</code></p>
  
  <pre><code>import React from "react";
  
  export default function App() {
    const [counter, setCounter] = React.useState(120);
    React.useEffect(() =&gt; {
      counter &gt; 0 &amp;&amp; setTimeout(() =&gt; setCounter(counter - 1), 1000);
    }, [counter]);
  
    return (
      &lt;div className="App"&gt;
        &lt;div&gt;Countdown: {counter === 0 ? "Time over" : counter}&lt;/div&gt;
      &lt;/div&gt;
    );
  }
  
  </code></pre>