State is for values that affect rendering. A ref object persists across renders and setting current does not request a render. Use a ref for an imperative value such as a timer ID or DOM node. Don’t use ref mutations as a hidden rendering input.
Follow-up Interview Question · How would you clear a timer on unmount without making the timer ID state?