A regular local variable is initialized again whenever the component renders. React preserves the ref object, so its current value remains available across renders.
Question 3 of 20 in useRef