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
Call `useState` at the top level of your component to declare a [state variable.](/learn/state-a-components-memory)
23
+
একটি [state variable](/learn/state-a-components-memory) ডিক্লেয়ার করার জন্য আপনার কম্পোনেন্টের একদম উপরে `useState`কল করুন:
24
24
25
25
```js
26
26
import { useState } from'react';
@@ -32,14 +32,14 @@ function MyComponent() {
32
32
// ...
33
33
```
34
34
35
-
The convention is to name state variables like `[something, setSomething]`using [array destructuring.](https://javascript.info/destructuring-assignment)
35
+
State ভ্যারিয়েবলগুলির নামকরণের রীতি হলো `[something, setSomething]`এই ধরনের [অ্যারে ডিস্ট্রাকচারিং](https://javascript.info/destructuring-assignment) ব্যবহার করে।
36
36
37
-
[See more examples below.](#usage)
37
+
[নিচে আরো উদাহরণ দেখুনঃ](#usage)
38
38
39
39
#### Parameters {/*parameters*/}
40
40
41
-
* `initialState`: The value you want the state to be initially. It can be a value of any type, but there is a special behavior for functions. This argument is ignored after the initial render.
42
-
* If you pass a function as `initialState`, it will be treated as an _initializer function_. It should be pure, should take no arguments, and should return a value of any type. React will call your initializer function when initializing the component, and store its return value as the initial state. [See an example below.](#avoiding-recreating-the-initial-state)
41
+
* `initialState`: আপনি শুরুতে state হিসাবে কি মান রাখতে চান তা। এটি যেকোনো টাইপের মান হতে পারে, কিন্তু ফাংশনের জন্য একটি বিশেষ আচরণ আছে। এই আর্গুমেন্টটি প্রথম রেন্ডারের পরে অবহেলা করা হয়।
42
+
*আপনি যদি একটি ফাংশনকে `initialState` হিসেবে পাঠিয়ে দেন, তাহলে এটি _initializer function_ হিসেবে গণ্য করা হবে । এটি নির্ভুল হওয়া উচিত, কোনো আর্গুমেন্ট গ্রহণ করা উচিত নয় এবং যে কোনো ধরনের মান রিটার্ন দেওয়া উচিত | React আপনার initializer ফাংশনকে কম্পোনেন্টটি ইনিশিয়ালাইজ করার সময় কল করবে এবং এর রিটার্ন ভ্যালুকে initial state হিসেবে সংরক্ষণ করবে। [নিচে একটি উদাহরণ দেখুন:](#avoiding-recreating-the-initial-state)
0 commit comments