Interview Q&A / React
React interview questions
Rendering, state, hooks, keys and effects, explained with small examples.
Prefer rapid revision? Practise React short interview answers →
- What does the dependency array do in useEffect?
It tells React when to re-run the effect. No array means after every render, an empty array means once after mount, and a list of values means after renders where one of them changed, compared with Object.is.
BeginnerQuick answer1 min read