Bug: `setState` function changes on every re-render
ChocolateLoverRaj opened this issue · comments
In the normal React.useState()
, the setState
function never changes. This is great when used in a React.useEffect()
dependency array, because then it is not called every time the setState
function changes.
However, useBatchedState
behaves differently than expected. The setter function changes on every re-render, which can mess up calls to React.useEffect
.
- I can make a pull request fixing this issue.