const [stuff, set_stuff] = useState("a")
...
set_stuff("a")
when set_stuff("a") is run, will it trigger downstream?
As per the documentation (of which another part was cited in the comments),
If you update a State Hook to the same value as the current state, React will bail out without rendering the children or firing effects. (React uses the
Object.iscomparison algorithm.)
which means that no, setting the state to the same value it had should not trigger a re-render or re-computing any dependents; set_stuff(stuff) should generally be a no-op. Of course, a re-render may trigger at the same time for unrelated reasons.
Also, remember that Object.is compares objects by identity (so-called ‘shallow’ equality), which means updating the state to an object with the same properties as the old one will not be considered identical and will trigger a re-render, even if the programmer considers the new state equivalent.