Skip to content

Commit f1510dd

Browse files
committed
feat: ✨ Translated Challenge 2 of 4 (partial)
Signed-off-by: HabibMollah <habib.prodev@gmail.com>
1 parent 49e88b0 commit f1510dd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,9 +1854,9 @@ textarea {
18541854

18551855
</Sandpack>
18561856

1857-
The resulting behavior is the same. But keep in mind that action types should ideally describe "what the user did" rather than "how you want the state to change". This makes it easier to later add more features.
1857+
উভয় পদ্ধতির ফলাফল একই। তবে মনে রাখবেন, নিয়ম হচ্ছে action এর type যেন "আপনি ষ্টেটের পরিবর্তন কিভাবে চান" সেটা প্রকাশ না করে "ইউজার কি করলো" সেটা যেন প্রকাশ করে। এটা পরবর্তীতে আরো ফিচার যোগ করাটা সহজ করবে।
18581858

1859-
With either solution, it's important that you **don't** place the `alert` inside a 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 এর ভিতর **রাখবেন না** 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.)
18601860

18611861
</Solution>
18621862

0 commit comments

Comments
 (0)