You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the re-render warning for using useIsFocused (#1299)
* fixes the re-render warning for using useIsFocused
It re-renders the direct component that contains this hook, but it was mentioned that it re-renders the screen.
* updates use-is-focused.md for v7.x
* updates use-is-focused.md for v6.x
* Update versioned_docs/version-6.x/use-is-focused.md
Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
* Update use-is-focused.md for v7.x
---------
Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
Copy file name to clipboardExpand all lines: versioned_docs/version-6.x/use-is-focused.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ function Profile() {
20
20
}
21
21
```
22
22
23
-
Note that using this hook triggers a re-render for the screen when it changes focus. This might cause lags during the animation if your screen is heavy. You might want to extract the expensive parts to separate components and use [`React.memo`](https://reactjs.org/docs/react-api.html#reactmemo) or [`React.PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent) to minimize re-renders for them.
23
+
Note that using this hook triggers a re-render for the component when the screen it's in changes focus. This might cause lags during the animation if your component is heavy. You might want to extract the expensive parts to separate components and use [`React.memo`](https://reactjs.org/docs/react-api.html#reactmemo) or [`React.PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent) to minimize re-renders for them.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/use-is-focused.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ function Profile() {
20
20
}
21
21
```
22
22
23
-
Note that using this hook triggers a re-render for the screen when it changes focus. This might cause lags during the animation if your screen is heavy. You might want to extract the expensive parts to separate components and use [`React.memo`](https://reactjs.org/docs/react-api.html#reactmemo) or [`React.PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent) to minimize re-renders for them.
23
+
Note that using this hook triggers a re-render for the component when the screen it's in changes focus. This might cause lags during the animation if your component is heavy. You might want to extract the expensive parts to separate components and use [`React.memo`](https://reactjs.org/docs/react-api.html#reactmemo) or [`React.PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent) to minimize re-renders for them.
0 commit comments