Browse Source

Corrected a typo. (#8837)

shoud -> should
main
EugeneGarbuzov 8 years ago
committed by Brandon Dail
parent
commit
3aa1d52f96
  1. 2
      docs/optimizing-performance.md

2
docs/optimizing-performance.md

@ -184,7 +184,7 @@ class WordAdder extends React.Component {
}
```
The problem is that `PureComponent` will do a simple comparison between the old and new values of `this.props.words`. Since this code mutates the `words` array in the `handleClick` method of `WordAdder`, the old and new values of `this.props.words` will compare as equal, even though the actual words in the array have changed. The `ListOfWords` will thus not update even though it has new words that shoud be rendered.
The problem is that `PureComponent` will do a simple comparison between the old and new values of `this.props.words`. Since this code mutates the `words` array in the `handleClick` method of `WordAdder`, the old and new values of `this.props.words` will compare as equal, even though the actual words in the array have changed. The `ListOfWords` will thus not update even though it has new words that should be rendered.
## The Power Of Not Mutating Data

Loading…
Cancel
Save