Skip to content
BENIBIX Learn

Props

Development🌐 Web DevelopmentFrameworks

Also known as Properties, Component Props, Component Inputs

The inputs a component gets from the part that holds it.

Think of it like

Think of it like a name tag you hand to someone. They wear whatever name you give them.

Example

Lucy's page uses the same Button component three times. Its label prop is Save, Cancel and Delete.

Why it matters

Props are what make components reusable. Data flows down through them.

Definition

Props are the inputs a parent component passes to a child component. They let one component show different things in different places, like a different name or price. A child reads its props but should not change them. If something needs to change, the parent changes the value and passes it down again. The name is short for properties.

Example code

jsx
<Greeting name="Emma" />
<Greeting name="Jack" />
One component, two different names passed in.

Common mistake

Changing a prop inside the child. It breaks the one-way flow and causes confusing bugs.

Key takeaways

  1. 1
    Inputs from the parent. Passed down, not up.
  2. 2
    Read, do not change. The parent owns the value.
  3. 3
    Makes reuse easy. Same part, different data.

Compare