Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactuseCallbackSingle-choice MCQ

A child wrapped in React.memo receives an `onClick` handler. The parent wraps that handler in `useCallback` with an empty dependency array, but the handler closes over a state value `selected`. What bug does this introduce?

const handleClick = useCallback(() => { console.log(selected); }, []); return <MemoChild onClick={handleClick} />;