Skip to content

Commit

Permalink
Update components-and-hooks-must-be-pure.md (#7245)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanderand authored Oct 23, 2024
1 parent e628e5d commit eb174dd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 doesn’t affect the rendering of other components, React doesn’t care if it’s 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).

Expand Down

0 comments on commit eb174dd

Please sign in to comment.