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

You memoize a function with useCallback so a child can keep a stable reference. The callback reads a piece of state but you leave the dependency array empty to keep the reference truly stable across renders. What is the real consequence?

const [count, setCount] = useState(0); const log = useCallback(() => { console.log(count); }, []);