Browse Source

Added reconciliation link. (#2614)

Co-authored-by: Sunil Pai <threepointone@oculus.com>
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
main
MohammadReza 4 years ago
committed by GitHub
parent
commit
f595f22c72
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/docs/higher-order-components.md

2
content/docs/higher-order-components.md

@ -320,7 +320,7 @@ Higher-order components come with a few caveats that aren't immediately obvious
### Don't Use HOCs Inside the render Method {#dont-use-hocs-inside-the-render-method}
React's diffing algorithm (called reconciliation) uses component identity to determine whether it should update the existing subtree or throw it away and mount a new one. If the component returned from `render` is identical (`===`) to the component from the previous render, React recursively updates the subtree by diffing it with the new one. If they're not equal, the previous subtree is unmounted completely.
React's diffing algorithm (called [Reconciliation](/docs/reconciliation.html)) uses component identity to determine whether it should update the existing subtree or throw it away and mount a new one. If the component returned from `render` is identical (`===`) to the component from the previous render, React recursively updates the subtree by diffing it with the new one. If they're not equal, the previous subtree is unmounted completely.
Normally, you shouldn't need to think about this. But it matters for HOCs because it means you can't apply a HOC to a component within the render method of a component:

Loading…
Cancel
Save