import "./styles.css";
import React, { useState, useEffect } from "react";
export default function App() {
const [count, setCount] = useState(0);
useEffect(() => {
console.warn("render");
});
function btnClick() {
setCount(count + 1);
setCount(count + 1);
}
return (
<div className="App">
{count}
<button onClick={btnClick}>Click Me</button>
</div>
);
}
Button Click only increase by 1, not by 2 and also render once.Any specific behaviour of useState?