Update components-and-hooks-must-be-pure.md (#7245)

This commit is contained in:
Andre Sander
2024-10-23 18:12:04 +02:00
committed by GitHub
parent e628e5df0d
commit eb174dd932

View File

@@ -194,7 +194,7 @@ function ProductDetailPage({ product }) {
}
```
One way to achieve the desired result of updating `window.title` outside of render is to [synchronize the component with `window`](/learn/synchronizing-with-effects).
One way to achieve the desired result of updating `document.title` outside of render is to [synchronize the component with `document`](/learn/synchronizing-with-effects).
As long as calling a component multiple times is safe and doesnt affect the rendering of other components, React doesnt care if its 100% pure in the strict functional programming sense of the word. It is more important that [components must be idempotent](/reference/rules/components-and-hooks-must-be-pure).