Corrected a typo. (#8837)

shoud -> should
This commit is contained in:
EugeneGarbuzov
2017-01-20 22:25:21 +03:00
committed by Brandon Dail
parent 6ab71526ee
commit 3aa1d52f96

View File

@@ -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