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/StrictMode.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -505,7 +505,7 @@ When Strict Mode is on, React will also run **one extra setup+cleanup cycle in d
505
505
506
506
**Here is an example to illustrate how re-running Effects in Strict Mode helps you find bugs early.**
507
507
508
-
Consider this example that connects a component to a chat:
508
+
এই উদাহরণটি বিবেচনা করুন যা একটি কম্পোনেন্টকে একটি চ্যাটে সংযুক্ত করে:
509
509
510
510
<Sandpack>
511
511
@@ -562,9 +562,9 @@ button { margin-left: 10px; }
562
562
563
563
</Sandpack>
564
564
565
-
There is an issue with this code, but it might not be immediately clear.
565
+
এই কোডে একটি সমস্যা রয়েছে, কিন্তু এটি সঙ্গে সঙ্গে স্পষ্ট নাও হতে পারে।
566
566
567
-
To make the issue more obvious, let's implement a feature. In the example below, `roomId`is not hardcoded. Instead, the user can select the`roomId` that they want to connect to from a dropdown. Click "Open chat" and then select different chat rooms one by one. Keep track of the number of active connections in the console:
567
+
সমস্যাটি আরও স্পষ্ট করতে, চলুন একটি ফিচার বাস্তবায়ন করি। নীচের উদাহরণে, `roomId`হার্ডকোডেড নয়। বরং, ব্যবহারকারী ড্রপডাউন থেকে তারা যে`roomId`-এ সংযুক্ত হতে চান তা নির্বাচন করতে পারে। "Open chat" ক্লিক করুন এবং তারপর একে একে বিভিন্ন চ্যাট রুম নির্বাচন করুন। কনসোলে সক্রিয় সংযোগের সংখ্যা লক্ষ্য রাখুন:
568
568
569
569
<Sandpack>
570
570
@@ -646,7 +646,7 @@ button { margin-left: 10px; }
646
646
647
647
</Sandpack>
648
648
649
-
You'll notice that the number of open connections always keeps growing. In a real app, this would cause performance and network problems. The issue is that [your Effect is missing a cleanup function:](/learn/synchronizing-with-effects#step-3-add-cleanup-if-needed)
649
+
আপনি লক্ষ্য করবেন যে খোলা সংযোগের সংখ্যা সর্বদা বাড়তে থাকে। একটি বাস্তব অ্যাপে, এটি পারফরম্যান্স এবং নেটওয়ার্ক সমস্যা তৈরি করবে। সমস্যাটি হলো [আপনার ইফেক্টে একটি ক্লিনআপ ফাংশনের অভাব:](/learn/synchronizing-with-effects#step-3-add-cleanup-if-needed)
650
650
651
651
```js {4}
652
652
useEffect(() => {
@@ -656,7 +656,7 @@ You'll notice that the number of open connections always keeps growing. In a rea
656
656
}, [roomId]);
657
657
```
658
658
659
-
Now that your Effect "cleans up" after itself and destroys the outdated connections, the leak is solved. However, notice that the problem did not become visible until you've added more features (the select box).
659
+
এখন যেহেতু আপনার ইফেক্ট "নিজের ঝামেলা পরিষ্কার" করে এবং পুরানো সংযোগগুলি ধ্বংস করে, লিক সমাধান হয়েছে। তবে, লক্ষ্য করুন যে সমস্যাটি তখনই প্রকাশ পেল যখন আপনি আরও বৈশিষ্ট্য (সিলেক্ট বক্স) যোগ করেছেন।
660
660
661
661
**In the original example, the bug wasn't obvious. Now let's wrap the original (buggy) code in `<StrictMode>`:**
0 commit comments