Concept
Props are the arguments a parent passes to a child: data, configuration and callbacks. They flow one way, down the tree, and a child never changes the props it receives.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Passing props doing its job.
function Avatar({ src, size = 40, onClick }: {
src: string;
size?: number;
onClick?: () => void;
}) {
return <img src={src} width={size} height={size} onClick={onClick} alt="" />;
}
<Avatar src="/ada.png" size={64} onClick={() => openProfile("ada")} />Mutating a prop, such as props.items.push(x). The parent still owns that array, nothing re-renders, and the next render shows a surprising state. Ask the parent to change it through a callback.
Your roadmap puts these before Passing props, unless you already know them.
Once a session shows you understand Passing props, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Passing props.