Props and Data Flow

Harry · 22 Sep 2026 · 1 views
Log in to track your progress and mark lessons complete.

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.
Share this post:

Comments (0)

Please login or register to comment.

Create a free account to keep reading

You've enjoyed a free tutorial! Register (it's free) to unlock every tutorial, track your progress and save code.

or sign in with your account

Already have an account? Log in