Skip to content

Add section about not spreading props #1443

@ljharb

Description

@ljharb

Spread props should be avoided, except for exceptions like:

  • HOCs that proxy down props and hoist propTypes
  • spreading objects with known, explicit props - like if you construct an object literal (statically or via a "pick" pattern) and then promptly spread it
  • others?

Let's add a section to the React guide about this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions