> Yes, and the input includes state. ... state is an input.
This is the same argument that the member variables of an OO object are additional input to its member method and the method is "pure."
> how a component function's output can change given the same props and state?
This is the same argument that given the same values of the member variables of an OO object and the same method arguments to its member method, the method returns the same value.
All these are just twisting the meaning of words and concepts to fit the square React into a functional round hole.
> a basic rule that is one of the first things you learn: components should be pure functions with respect to props and state.
You can certainly mutate the state in a React component; otherwise, what's the purpose of [.., setXX] = useState()? If such a "rule" is so important, why don't React remove the ability?
BTW, the "rules of hooks" are another set of extra burdens. All these rules imposed on the programmers are there due to React's weak design.
> And that's the problem: with arbitrary code, there is no such thing as a distinct "block of code". One function can read value A, set it to B, then call another function, which sees value B, does something as a result, and then it renders. But that's wrong: value B has not been persisted to the DOM yet, so it should not have been read by the second function. Now you're in trouble, because your component is behaving as if both A and B are true at the same time.
If every renderer can detect every single update of a variable/state, the above is a non-issue. Function1 can set v1 to A. The renderer detects the change to v1 and renders it as A. Function2 set v1 to B; the renderer detects it and renders it to B. Function1 and Function2 can be called in any order; the rendering output is consistent with the state. The renderer might be called twice but who cares the eventual outcome is the same (certainly there're memorizing optimization to avoid re-rendering). It's really React's weak design causing all the out-of-sync rendering problems.