Type 1:
const [count, setCount] = useState(initialCount);
<button onClick={() => setCount(count + 1)}>+</button>
Type 2:
const [count, setCount] = useState(initialCount);
<button onClick={() => setCount(prevCount => prevCount + 1)}>+</button>
Though the both above code give the same result, what exactly is difference between them and why 2nd method is preferred than the first one