From 4e3f20814f5a9e1ec906c35f049ac084a07066b9 Mon Sep 17 00:00:00 2001 From: Yusong Liu Date: Wed, 8 Jun 2016 14:09:50 +0800 Subject: [PATCH] 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. --- docs/10.10-shallow-compare.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/10.10-shallow-compare.md b/docs/10.10-shallow-compare.md index 4ce3ee41..08f30c5b 100644 --- a/docs/10.10-shallow-compare.md +++ b/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.