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 →
- How would you write a simple useFetch custom hook?
Keep data, loading and error in state, fetch inside an effect keyed on the URL, and ignore or abort stale responses in the cleanup. Return the three values so components stay free of fetching details.
IntermediateQuick answer1 min read