default prop value

A value a component uses for a prop when the caller leaves that prop out.

In more detail

In function components you set it with JavaScript destructuring defaults, as in function Box({ variant = "primary" }). The older defaultProps field is not supported on function components in React 19. The default applies only when the prop is missing or undefined, not when it is null.

Related terms

Taught in

References