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
Copy file name to clipboardExpand all lines: content/docs/hooks-faq.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -845,12 +845,12 @@ function Image(props) {
845
845
846
846
* يمكِّنك الخطاف [`useCallback`](/docs/hooks-reference.html#usecallback) من الإبقاء على مرجع رد النداء نفسه بين عمليات إعادة التصيير، لذا يستمر `shouldComponentUpdate` بالعمل:
847
847
848
-
```js{2}
849
-
// `b` أو `a` لن يتغير إلا إذا تغير
850
-
const memoizedCallback = useCallback(() => {
851
-
doSomething(a, b);
852
-
}, [a, b]);
853
-
```
848
+
```js{2}
849
+
// `b` أو `a` لن يتغير إلا إذا تغير
850
+
const memoizedCallback = useCallback(() => {
851
+
doSomething(a, b);
852
+
}, [a, b]);
853
+
```
854
854
855
855
* يجعل [الخطاف `useMemo`](/docs/hooks-faq.html#how-to-memoize-calculations) عملية التحكم سهلةً عندما يَجرِي تحديث ابنٍ واحدٍ، مما يقلل من الحاجة إلى مكونات نقية (pure components).
0 commit comments