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/Fragment.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: <Fragment> (<>...</>)
4
4
5
5
<Intro>
6
6
7
-
`<Fragment>`, often used via`<>...</>`syntax, lets you group elements without a wrapper node.
7
+
`<Fragment>`, যেটা বেশিরভাগ সময়`<>...</>`সিনট্যাক্স ব্যবহার করে প্রকাশ করা হয়, আপনাকে একটা wrapper নোড ছাড়াই এলিমেন্ট গ্রুপ করার সুবিধা দেবে।
8
8
9
9
```js
10
10
<>
@@ -19,29 +19,29 @@ title: <Fragment> (<>...</>)
19
19
20
20
---
21
21
22
-
## Reference {/*reference*/}
22
+
## রেফারেন্স {/*reference*/}
23
23
24
24
### `<Fragment>` {/*fragment*/}
25
25
26
-
Wrap elements in `<Fragment>`to group them together in situations where you need a single element. Grouping elements in `Fragment` has no effect on the resulting DOM; it is the same as if the elements were not grouped. The empty JSX tag`<></>`is shorthand for `<Fragment></Fragment>`in most cases.
26
+
যেসব ক্ষেত্রে আপনার একটি মাত্র এলিমেন্ট লাগবে `<Fragment>`এর মধ্যে একাধিক এলিমেন্ট গ্রুপ করে wrap করে ফেলুন। `Fragment` এর মধ্যে গ্রুপ করা হলে ফলাফলে যে DOM পাওয়া যায় তার উপর কোন প্রভাব পড়ে না; গ্রুপ করা না হলে যেমন হত ঠিক তেমনি ঘটে। বেশিরভাগ ক্ষেত্রে খালি JSX ট্যাগ`<></>`কে `<Fragment></Fragment>`প্রকাশ করতে সংক্ষেপে ব্যবহার করা হয়।
27
27
28
28
#### Props {/*props*/}
29
29
30
-
-**optional**`key`: Fragments declared with the explicit `<Fragment>`syntax may have [keys.](/learn/rendering-lists#keeping-list-items-in-order-with-key)
30
+
-**অপশনাল**`key`: যেসব ফ্র্যাগমেন্ট স্পষ্টভাবে `<Fragment>`সিনট্যাক্স দিয়ে ডিক্লেয়ার করা হয় তাদের [keys](/learn/rendering-lists#keeping-list-items-in-order-with-key) থাকতে পারে।
31
31
32
-
#### Caveats {/*caveats*/}
32
+
#### সতর্কতা {/*caveats*/}
33
33
34
-
-If you want to pass `key`to a Fragment, you can't use the `<>...</>`syntax. You have to explicitly import `Fragment` from `'react'`and render `<Fragment key={yourKey}>...</Fragment>`.
34
+
-আপনি যদি একটা ফ্র্যাগমেন্টে `key`পাস করতে চান, আপনি `<>...</>`সিনট্যাক্স ব্যবহার করতে পারবেন না। আপনাকে স্পষ্টভাবে `'react'`থেকে `Fragment` ইমপোর্ট করতে হবে এবং `<Fragment key={yourKey}>...</Fragment>` রেন্ডার করতে হবে।
35
35
36
-
-React does not [reset state](/learn/preserving-and-resetting-state) when you go from rendering `<><Child /></>`to`[<Child />]`or back, or when you go from rendering`<><Child /></>`to`<Child />`and back. This only works a single level deep: for example, going from `<><><Child /></></>`to`<Child />`resets the state. See the precise semantics [here.](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b)
36
+
-যখন আপনি `<><Child /></>`থেকে`[<Child />]`রেন্ডারিং এ চলে যান বা ফিরে আসেন, অথবা`<><Child /></>`থেকে`<Child />`রেন্ডারিং এ যান এবং ফিরে আসেন React [state রিসেট](/learn/preserving-and-resetting-state) করে না। এটা শুধুমাত্র এক স্তর গভীরে কাজ করেঃ উদাহরণস্বরূপ, `<><><Child /></></>`থেকে`<Child />`এ গেলে state রিসেট হয়। সুনির্দিষ্ট semantics দেখুন [এখানে।](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b)
37
37
38
38
---
39
39
40
-
## Usage {/*usage*/}
40
+
## ব্যবহার {/*usage*/}
41
41
42
-
### Returning multiple elements {/*returning-multiple-elements*/}
42
+
### একাধিক এলিমেন্ট রিটার্নিং {/*returning-multiple-elements*/}
43
43
44
-
Use `Fragment`, or the equivalent `<>...</>`syntax, to group multiple elements together. You can use it to put multiple elements in any place where a single element can go. For example, a component can only return one element, but by using a Fragment you can group multiple elements together and then return them as a group:
44
+
একাধিক এলিমেন্ট গ্রুপ করতে `Fragment` বা সমার্থক `<>...</>`সিনট্যাক্স ব্যবহার করুন। এমন যেকোন জায়গা যেখানে একটি এলিমেন্ট যেতে পারে সেখানে আপনি একাধিক এলিমেন্ট রাখার জন্য এটা ব্যবহার করতে পারেন। উদাহরণস্বরূপ, একটা কম্পোনেন্ট শুধুমাত্র একটি এলিমেন্ট রিটার্ন করতে পারে, কিন্তু ফ্র্যাগমেন্ট ব্যবহার করে আপনি একাধিক এলিমেন্টকে একসাথে করে গ্রুপ হিসেবে রিটার্ন করতে পারেনঃ
45
45
46
46
```js {3,6}
47
47
functionPost() {
@@ -54,7 +54,7 @@ function Post() {
54
54
}
55
55
```
56
56
57
-
Fragments are useful because grouping elements with a Fragment has no effect on layout or styles, unlike if you wrapped the elements in another container like a DOM element. If you inspect this example with the browser tools, you'll see that all `<h1>`and`<article>` DOM nodes appear as siblings without wrappers around them:
57
+
ফ্র্যাগমেন্ট কাজে লাগে কারণ ফ্র্যাগমেন্টে এলিমেন্ট গ্রুপ করলে সেটা লেআউট বা স্টাইলে কোন প্রভাব ফেলে না, যে সুবিধাটা আপনি DOM এলিমেন্টের মত অন্য একটা কনটেইনারে এলিমেন্টগুলো wrap করলে পেতেন না। আপনি যদি ব্রাউজার টুল ব্যবহার করে এই উদাহরণটি inspect করেন, দেখবেন যে সব `<h1>`এবং`<article>` DOM নোডকে sibling হিসেবে দেখায়। তাদের ঘিরে কোন wrapper দেখবেন নাঃ
58
58
59
59
<Sandpack>
60
60
@@ -94,9 +94,9 @@ function PostBody({ body }) {
94
94
95
95
<DeepDive>
96
96
97
-
#### How to write a Fragment without the special syntax? {/*how-to-write-a-fragment-without-the-special-syntax*/}
97
+
#### বিশেষ সিনট্যাক্স ব্যবহার না করে কীভাবে একটি ফ্র্যাগমেন্ট লিখতে হয়? {/*how-to-write-a-fragment-without-the-special-syntax*/}
98
98
99
-
The example above is equivalent to importing `Fragment`from React:
99
+
উপরের এই উদাহরণটি React থেকে `Fragment`ইমপোর্ট করার মতই কাজ করবেঃ
100
100
101
101
```js {1,5,8}
102
102
import { Fragment } from'react';
@@ -111,15 +111,15 @@ function Post() {
111
111
}
112
112
```
113
113
114
-
Usually you won't need this unless you need to [pass a `key` to your `Fragment`.](#rendering-a-list-of-fragments)
114
+
সাধারণত আপনার এর দরকার পড়বে না যদি না আপনার [`Fragment` এ একটা `key` পাস করার](#rendering-a-list-of-fragments) প্রয়োজন পড়ে।
115
115
116
116
</DeepDive>
117
117
118
118
---
119
119
120
-
### Assigning multiple elements to a variable {/*assigning-multiple-elements-to-a-variable*/}
120
+
### একটি ভ্যারিয়েবলে একাধিক এলিমেন্ট এসাইনিং {/*assigning-multiple-elements-to-a-variable*/}
121
121
122
-
Like any other element, you can assign Fragment elements to variables, pass them as props, and so on:
122
+
অন্য যেকোন এলিমেন্টের মত, আপনি ফ্র্যাগমেন্ট এলিমেন্ট ভ্যারিয়েবলে এসাইন করতে পারবেন, prop হিসেবে পাস করতে পারবেন, এবং আরো যা যা করা যায় করতে পারবেনঃ
123
123
124
124
```js
125
125
functionCloseDialog() {
@@ -139,9 +139,9 @@ function CloseDialog() {
139
139
140
140
---
141
141
142
-
### Grouping elements with text {/*grouping-elements-with-text*/}
142
+
### টেক্সটের সাথে এলিমেন্ট এর গ্রুপিং {/*grouping-elements-with-text*/}
143
143
144
-
You can use `Fragment` to group text together with components:
144
+
আপনি কম্পোনেন্টের সাথে টেক্সট গ্রুপ করতে চাইলে `Fragment` ব্যবহার করতে পারেনঃ
145
145
146
146
```js
147
147
functionDateRangePicker({ start, end }) {
@@ -158,9 +158,9 @@ function DateRangePicker({ start, end }) {
158
158
159
159
---
160
160
161
-
### Rendering a list of Fragments {/*rendering-a-list-of-fragments*/}
161
+
### ফ্র্যাগমেন্টের একটা তালিকার রেন্ডার {/*rendering-a-list-of-fragments*/}
162
162
163
-
Here's a situation where you need to write `Fragment` explicitly instead of using the `<></>` syntax. When you [render multiple elements in a loop](/learn/rendering-lists), you need to assign a`key`to each element. If the elements within the loop are Fragments, you need to use the normal JSX element syntax in order to provide the `key` attribute:
163
+
এখানে এমন একটা অবস্থা দেখা যাচ্ছে যেখানে আপনাকে `<></>` এর জায়গায় স্পষ্টভাবে `Fragment` সিনট্যাক্স ব্যবহার করতে হবে। যখন আপনি [একটা লুপে একাধিক এলিমেন্ট রেন্ডার করছেন](/learn/rendering-lists), আপনাকে প্রতি এলিমেন্টের জন্য একটি`key`ঠিক করে দিতে হবে। যদি লুপের মধ্যকার এলিমেন্টগুলা ফ্র্যাগমেন্ট হয়, আপনাকে `key` এট্রিবিউট দেবার জন্য সাধারণ JSX এলিমেন্ট সিনট্যাক্স ব্যবহার করতে হবেঃ
164
164
165
165
```js {3,6}
166
166
functionBlog() {
@@ -173,7 +173,7 @@ function Blog() {
173
173
}
174
174
```
175
175
176
-
You can inspect the DOM to verify that there are no wrapper elements around the Fragment children:
176
+
আপনি DOM এ inspect করে দেখতে পারেন ফ্র্যাগমেন্ট চিলড্রেন এর আসে পাশে কোন wrapper এলিমেন্ট নেইঃ
0 commit comments