Repaso
EspaƱol

In React, props vs state?

Options

  1. They are the same thing under two different names
  2. Props are inputs from the parent; state is internal (Correct option)
  3. State comes only from the server, never from users
  4. Props can only be strings, never objects or numbers

Answer

Props are inputs passed from the parent (read-only for the child); state is data the component owns and can change, triggering a re-render

Why

Props are like function arguments: the parent passes them, the child reads them but must not change them.

State is the component's own memory (useState). When you update it with the setter, React re-renders the component with the new value.

If the child needs to change something, the parent passes a function as a prop (e.g. onChange).

Remember

Props = given by the parent. State = owned and changeable.

Key terms

Practice this question in Repaso