Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactuseEffect dependency arraysSingle-choice MCQ

Given this component, how many times does the effect run across the initial mount plus two parent re-renders where `count` stays the same value but `onChange` is a new inline function each render?

function Child({ count, onChange }) { useEffect(() => { console.log('run'); }, [count, onChange]); return null; } // parent passes onChange={() => {}} inline, count={0} all three renders