Skip to content
Justice Tech School

Spreading Props

The spread operator forwards an object as props.

Example
function Button(props) {
  return <button {...props} className="btn" />;
}
const p = { type: "submit", disabled: false };
<Button {...p}>Send</Button>;

Exercise

Forward props.

<button props} />

Quiz Test

What does {...props} do?

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