arrow_backBACK TO DRILLS
Black BeltrenderingPREMIUM
Calling setState with an Already-Current Value
A component calls setCount(5) inside an onClick handler while count is already 5.
REACT_MODULE // 0x42
function Widget({ count, setCount }) {
console.log('Widget rendered');
return <button onClick={() => setCount(5)}>{count}</button>;
}If count is already 5 when the button is clicked, how many times does "Widget rendered" print as a result of that single click?