Props and Data Flow
Harry
· 22 Sep 2026
· 1 views
Log in to track your progress and mark lessons complete.
Sponsored
What Are Props?
Props are read-only data passed from parent to child - the configuration of a component.
Default Props and Validation
Provide fallbacks with default parameters and validate with PropTypes in development.
function Greeting({ name = 'Guest' }) {
return <h1>Hello, {name}</h1>;
}Props vs State
- Props - from parent, read-only.
- State - local, mutable via setter.
Key Points
- Data flows down; events flow up.
- Never mutate props inside a child.
- Deep drilling signals a need for Context.