useEffect lets you perform side effects (data fetching, subscriptions, DOM mutations) after the component renders. Its dependency array controls when it re-runs.
2 / 5
What does useState return?
useState returns an array of two items: the current state value and a function to update it, e.g. const [count, setCount] = useState(0).
3 / 5
When should you reach for useMemo?
useMemo memoizes the result of an expensive calculation so it is only recomputed when its dependencies change.
4 / 5
What is the purpose of useCallback?
useCallback returns a memoized version of a callback so the same function reference is preserved across renders, useful when passing callbacks to memoized children.
5 / 5
Which is a rule of hooks?
The rules of hooks require calling hooks only at the top level and only from React functions, so the call order stays stable between renders.