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: src/content/reference/react/useSyncExternalStore.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -401,9 +401,9 @@ function getSnapshot() {
401
401
402
402
---
403
403
404
-
### My`subscribe`function gets called after every re-render {/*my-subscribe-function-gets-called-after-every-re-render*/}
404
+
### আমার`subscribe`ফাংশনটি প্রতিটি রি-রেন্ডারের পরে কল হচ্ছে {/*my-subscribe-function-gets-called-after-every-re-render*/}
405
405
406
-
This`subscribe`function is defined *inside* a component so it is different on every re-render:
406
+
নিচের`subscribe`ফাংশনটি একটি কম্পোনেন্টের *ভেতরে* ডিক্লেয়ার করা হয়েছে তাই এটি প্রতিটি রি-রেন্ডারের সময়ই ভিন্ন:
407
407
408
408
```js {2-5}
409
409
functionChatIndicator() {
@@ -418,7 +418,7 @@ function ChatIndicator() {
418
418
}
419
419
```
420
420
421
-
React will resubscribe to your store if you pass a different `subscribe` function between re-renders. If this causes performance issues and you'd like to avoid resubscribing, move the `subscribe`function outside:
421
+
আপনি যদি রি-রেন্ডারের সময় একটি ভিন্ন `subscribe` ফাংশন পাস করেন তবে রিয়েক্ট আপনার স্টোরে পুনরায় সাবস্ক্রাইব করবে। এটি যদি পারফরম্যান্সে সমস্যা তৈরি করে এবং আপনি এই পুনরায় সাবস্ক্রাইব হওয়া এড়াতে চান, তবে `subscribe`ফাংশনটিকে কম্পোনেন্টের বাইরে নিয়ে যান:
422
422
423
423
```js {1-4}
424
424
// ✅ Always the same function, so React won't need to resubscribe
@@ -432,7 +432,7 @@ function ChatIndicator() {
432
432
}
433
433
```
434
434
435
-
Alternatively, wrap `subscribe`into [`useCallback`](/reference/react/useCallback) to only resubscribe when some argument changes:
435
+
বিকল্প হিসেবে, `subscribe`কে [`useCallback`](/reference/react/useCallback) এর ভেতরে র্যাপ (wrap) করতে পারেন যাতে এটি শুধুমাত্র তখনই রি-সাবস্ক্রাইব করে যখন কোনো আর্গুমেন্ট পরিবর্তন হয়:
0 commit comments