Browse Source

Fix the typo in the documentaion pages for shallowCompare (#6980)

* fix the typo for the docs of shallowCompare at:
https://facebook.github.io/react/docs/shallow-compare.html

* change "value" to "values" to match the two objects.
main
Yusong Liu 9 years ago
committed by Jim
parent
commit
4e3f20814f
  1. 2
      docs/10.10-shallow-compare.md

2
docs/10.10-shallow-compare.md

@ -26,7 +26,7 @@ export class SampleComponent extends React.Component {
```
`shallowCompare` performs a shallow equality check on the current `props` and `nextProps` objects as well as the current `state` and `nextState` objects.
It does this by iterating on the keys of the objects being compared and returning false when the value of a key in each object are not strictly equal.
It does this by iterating on the keys of the objects being compared and returning true when the values of a key in each object are not strictly equal.
`shallowCompare` returns `true` if the shallow comparison for props or state fails and therefore the component should update.
`shallowCompare` returns `false` if the shallow comparison for props and state both pass and therefore the component does not need to update.

Loading…
Cancel
Save