suggesting the use of immutable js for comparisons
Jason Bonta committed
Jan 7, 2015 at 10:46 UTC
cdec83732df3ec19fafaceafd8b930129222e4bd
1 file changed
+1
-1
docs/docs/10.7-pure-render-mixin.md
+1
-1
@@ -25,6 +25,6 @@ Under the hood, the mixin implements [shouldComponentUpdate](/react/docs/compone
25
26
> Note:
27
>
28
-> 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.
28
+> 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.
29
>
30
> Furthermore, `shouldComponentUpdate` skips updates for the whole component subtree. Make sure all the children components are also "pure".