
need help understanding state
so i was reading react.dev's state explanation
when react rerenders due to set function local variable wont be able to maintain its value since it rerenders everything but in its clock or time example where you can input a value on a input element it says that it chooses what to rerender and the value stays intact while the clock is running .
im also assuming that its using a set function to update the clock.
can anyone explain why this is?
edit
heres the link to the clock example
https://react.dev/learn/render-and-commit#step-3-react-commits-changes-to-the-dom