Concepts

JSX prop spread

Expands an object’s own enumerable properties into JSX props. Later values override earlier ones with the same name. Select known attributes before spreading.

Formal Syntax & Structure

react syntaxreact
JSX prop spread

Working Example

Example Snippetreact
const attrs = { type: "search", placeholder: "Name" };const field = <input {...attrs} placeholder="Author name" aria-label="Author" />;
React Reference