Skip to content

Commit d774b89

Browse files
authored
Merge pull request airbnb#1898 from kevinweber/react/props--unnecessary-props
List bad example first to be consistent
2 parents 685f37b + ced1cb3 commit d774b89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

react/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,16 +440,16 @@ This style guide is mostly based on the standards that are currently prevalent i
440440
Filter out unnecessary props when possible. Also, use [prop-types-exact](https://www.npmjs.com/package/prop-types-exact) to help prevent bugs.
441441

442442
```jsx
443-
// good
443+
// bad
444444
render() {
445445
const { irrelevantProp, ...relevantProps } = this.props;
446-
return <WrappedComponent {...relevantProps} />
446+
return <WrappedComponent {...this.props} />
447447
}
448448
449-
// bad
449+
// good
450450
render() {
451451
const { irrelevantProp, ...relevantProps } = this.props;
452-
return <WrappedComponent {...this.props} />
452+
return <WrappedComponent {...relevantProps} />
453453
}
454454
```
455455

0 commit comments

Comments
 (0)