useRef and createRef look almost identical — both return an object with a current property — but one of them silently breaks in function components. This is a favorite interview question because it checks whether you understand how renders actually work.
After this breakdown you'll know why useRef hands you the same ref object on every render, why createRef makes a brand new one each time the function runs, the subtle DOM/effect bugs that causes, and when each one is the right tool.
In this breakdown:
0:00 useRef vs createRef — why interviewers ask
0:15 useRef: a mutable container that persists across renders
0:35 createRef: a brand new ref object on every call
0:51 The key difference: same ref vs new ref each render
1:01 Why createRef breaks in function components (and the fix)
1:18 When to use each (function components vs class fields)
1:37 The interview-ready answer
1:49 Mental model: useRef is a small pocket inside the component
📘 Full breakdown — 70 Mid/Senior interview questions in "React Interview Deep Dive":
→ Amazon: https://www.amazon.com/dp/B0GX36S9KF
→ PDF (Gumroad): https://ivandeinichenko.gumroad.com/l...
▶ React Deep Dive playlist: • React Interview Deep Dive — How React Actu...
#react #reactinterview #frontend #useref #createref #reacthooks
On this page of the site you can watch the video online useRef vs createRef: why createRef breaks in function components | React Interview Deep Dive #13 with a duration of hours minute second in good quality, which was uploaded by the user React Deep Dive 08 July 2026, share the link with friends and acquaintances, this video has already been watched 10 times on youtube and it was liked by 4 viewers. Enjoy your viewing!