Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ced1cb3

Browse files
committed
List bad example first to be consistent
1 parent 685f37b commit ced1cb3

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)