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/learn/extracting-state-logic-into-a-reducer.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,25 +284,25 @@ dispatch({
284
284
285
285
</Note>
286
286
287
-
### Step 2: Write a reducer function {/*step-2-write-a-reducer-function*/}
287
+
### ধাপ ২: একটি reducer function লিখুন {/*step-2-write-a-reducer-function*/}
288
288
289
-
A reducer function is where you will put your state logic. It takes two arguments, the current state and the action object, and it returns the next state:
289
+
একটি reducer function হলো যেখানে আপনি আপনার state লজিক রাখবেন। এটি দুটি argument নেয়, বর্তমান state এবং action অবজেক্ট, অতঃপর এটি পরবর্তী state কে return করেঃ
290
290
291
291
```js
292
292
functionyourReducer(state, action) {
293
293
// return next state for React to set
294
294
}
295
295
```
296
296
297
-
React will set the state to what you return from the reducer.
297
+
আপনি reducer থেকে যা return করবেন, React সেটিকে state হিসেবে সেট করে দিবে।
298
298
299
-
To move your state setting logic from your event handlers to a reducer function in this example, you will:
299
+
এই উদাহরণে, state সেট করার লজিককে event handlers থেকে একটি reducer function এ সরাতে, আপনার:
300
300
301
-
1.Declare the current state (`tasks`) as the first argument.
302
-
2.Declare the `action`object as the second argument.
303
-
3.Return the _next_ state from the reducer (which React will set the state to).
301
+
1.বর্তমান state (`tasks`) কে প্রথম argument হিসেবে declare করতে হবে।
302
+
2.`action`অবজেক্টকে দ্বিতীয় argument হিসেবে declare করতে হবে।
303
+
3.reducer থেকে _পরবর্তী_ state কে return করতে হবে। (যেটিকে React পরবর্তী state হিসেবে সেট করবে)
304
304
305
-
Here is all the state setting logic migrated to a reducer function:
305
+
সব state সেট করার লজিক reducer function এ সরানোর পর এমন দেখাবেঃ
306
306
307
307
```js
308
308
functiontasksReducer(tasks, action) {
@@ -331,7 +331,7 @@ function tasksReducer(tasks, action) {
331
331
}
332
332
```
333
333
334
-
Because the reducer function takes state (`tasks`) as an argument, you can**declare it outside of your component.**This decreases the indentation level and can make your code easier to read.
334
+
যেহেতু reducer function টি state (`tasks`) কে একটি argument হিসেবে নিচ্ছে, আপনি একে**আপনার কম্পোনেন্টের বাইরে declare করতে পারবেন।**এটা indentation level কমিয়ে আনে এবং আপনার কোডকে পড়তে সহজ করে।
0 commit comments