Deep dive into the useState() Hook in React.js.
import {useState} from "react";
const Header = () => {
const [num, setnum] = useState(1);
function updater(){
console.log(num); // 1 (for the first time button click)
setnum((prevStateValue) => prevStateValue + 1);
console.log(num); // 1 (for the...
shyam3050.hashnode.dev2 min read