Skip to content

Commit 7a25576

Browse files
committed
feat: ✨ Translated Challenge 2 of 4
1 parent f1510dd commit 7a25576

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/content/learn/extracting-state-logic-into-a-reducer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ textarea {
18561856

18571857
উভয় পদ্ধতির ফলাফল একই। তবে মনে রাখবেন, নিয়ম হচ্ছে action এর type যেন "আপনি ষ্টেটের পরিবর্তন কিভাবে চান" সেটা প্রকাশ না করে "ইউজার কি করলো" সেটা যেন প্রকাশ করে। এটা পরবর্তীতে আরো ফিচার যোগ করাটা সহজ করবে।
18581858

1859-
উভয় সমাধানের ক্ষেত্রেই, এটা গুরুত্বপূর্ণ বিষয় যে আপনি `alert` টি কোনো reducer এর ভিতর **রাখবেন না**The reducer should be a pure function--it should only calculate the next state. It should not "do" anything, including displaying messages to the user. That should happen in the event handler. (To help catch mistakes like this, React will call your reducers multiple times in Strict Mode. This is why, if you put an alert in a reducer, it fires twice.)
1859+
উভয় সমাধানের ক্ষেত্রেই, এটা গুরুত্বপূর্ণ বিষয় যে আপনি `alert` টি কোনো reducer এর ভিতর **রাখবেন না**। Reducer হতে হবে একটি pure function--এটার কাজ যেন হয় শুধুই পরবর্তী ষ্টেট নির্ণয় করে। এটা যেন আর কিছুই না "করে", যেমন ইউজার কে কোনো বিজ্ঞপ্তি দেখানো। এসব করতে হবে ইভেন্ট হ্যান্ডলারে। (এই ধরণের ভুল থেকে বাঁচার জন্য, রিয়েক্ট Strict Mode এ আপনার reducer গুলোকে একাধিক বার কল করবে। একারণেই, আপনি যদি reducer এর মধ্যে কোনো alert কল করেন, এটা দুইবার দেখায়।)
18601860

18611861
</Solution>
18621862

0 commit comments

Comments
 (0)