Why does calling useState's setter with the same value subsequently trigger a component update even if the old state equals the new state?
问题 This problem occurs only if the state value was actually changed due to the previous update. In the following example, when the button is clicked for the first time, "setState" is called with a new value (of 12), and a component update occurs, which is understandable. When I click the same button for the second time, setting the state to the same value of 12 it causes the component to re-run (re-render), and why exactly that happens is my main question. Any subsequent setStates to the same