mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Simplify shouldComponentUpdate example [skip ci]
This commit is contained in:
@@ -164,7 +164,7 @@ transition to the new props and state will not require a component update.
|
||||
|
||||
```javascript
|
||||
shouldComponentUpdate: function(nextProps, nextState) {
|
||||
return !equal(nextProps, this.props) || !equal(nextState, this.state);
|
||||
return nextProps.id !== this.props.id;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user