Skip to content

Commit

Permalink
Merge pull request airbnb#1898 from kevinweber/react/props--unnecessa…
Browse files Browse the repository at this point in the history
…ry-props

List bad example first to be consistent
  • Loading branch information
ljharb authored Aug 27, 2018
2 parents 685f37b + ced1cb3 commit d774b89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,16 +440,16 @@ This style guide is mostly based on the standards that are currently prevalent i
Filter out unnecessary props when possible. Also, use [prop-types-exact](https://www.npmjs.com/package/prop-types-exact) to help prevent bugs.

```jsx
// good
// bad
render() {
const { irrelevantProp, ...relevantProps } = this.props;
return <WrappedComponent {...relevantProps} />
return <WrappedComponent {...this.props} />
}
// bad
// good
render() {
const { irrelevantProp, ...relevantProps } = this.props;
return <WrappedComponent {...this.props} />
return <WrappedComponent {...relevantProps} />
}
```

Expand Down

0 comments on commit d774b89

Please sign in to comment.