"The difference is that useEffect captures the value of count when the effect gets created." notice to the difference of current value and captured value.
captured value of the value (state)
setValue(value+1)
current value of the value (state)
setValue(value=>value+1)