suggesting the use of immutable js for comparisons

This commit is contained in:
Jason Bonta
2015-01-07 10:46:50 -08:00
parent a45472e050
commit cdec83732d
+1 -1
View File
@@ -25,6 +25,6 @@ Under the hood, the mixin implements [shouldComponentUpdate](/react/docs/compone
> Note:
>
> This only shallowly compares the objects. If these contain complex data structures, it may produce false-negatives for deeper differences. Only mix into components which have simple props and state, or use `forceUpdate()` when you know deep data structures have changed.
> This only shallowly compares the objects. If these contain complex data structures, it may produce false-negatives for deeper differences. Only mix into components which have simple props and state, or use `forceUpdate()` when you know deep data structures have changed. Or, consider using [immutable objects](http://facebook.github.io/immutable-js/) to facilitate fast comparisons of nested data.
>
> Furthermore, `shouldComponentUpdate` skips updates for the whole component subtree. Make sure all the children components are also "pure".