Use state for information that affects rendered output because updating state schedules a render. Mutating a ref alone would not update the displayed text.
Question 10 of 20 in useRef