Skip to content

Commit

Permalink
Merge pull request vasanthk#99 from Asymons/patch-1
Browse files Browse the repository at this point in the history
Update 01.shouldComponentUpdate-check.md
  • Loading branch information
vasanthk authored Jan 24, 2018
2 parents 3c9e7dd + 782dc7b commit 3c5a6c8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions perf-tips/01.shouldComponentUpdate-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ const AutocompleteItem = (props) => {
```javascript
export default class AutocompleteItem extends React.Component {
shouldComponentUpdate(nextProps, nextState) {
if (
nextProps.url !== this.props.url ||
nextProps.selected !== this.props.selected
) {
return true;
}
return false;
return nextProps.url !== this.props.url ||
nextProps.selected !== this.props.selected;
}

render() {
Expand Down

0 comments on commit 3c5a6c8

Please sign in to comment.