Skip to content
Justice Tech School

Props

Props pass data from a parent to a child, like function arguments. They are read only.

Example
function Greeting({ name, age = 18 }) {
  return <p>{name} is {age}</p>;
}

<Greeting name="Ada" age={30} />

Exercise

Pass a prop.

<Greeting ="Ada" />

Quiz Test

Can a child change its props?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.