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/Children.md
+41-41Lines changed: 41 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
-
title: Children
2
+
title: Children (Alt Eleman)
3
3
---
4
4
5
5
<Pitfall>
6
6
7
-
Using `Children`is uncommon and can lead to fragile code. [See common alternatives.](#alternatives)
7
+
`Children`kullanımı nadirdir ve kırılgan koda yol açabilir. [Yaygın alternatiflere bakın.](#alternatives)
8
8
9
9
</Pitfall>
10
10
11
11
<Intro>
12
12
13
-
`Children` lets you manipulate and transform the JSX you received as the [`children` prop.](/learn/passing-props-to-a-component#passing-jsx-as-children)
13
+
`Children`, [`children` prop'u](/learn/passing-props-to-a-component#passing-jsx-as-children) olarak aldığınız JSX'i değiştirmenize ve dönüştürmenize olanak tanır
Call `Children.count(children)` to count the number of children in the `children` data structure.
34
+
Children veri yapısındaki alt eleman sayısını saymak için `Children.count(children)` öğesini çağırın.
35
35
36
36
```js src/RowList.js active
37
37
import { Children } from'react';
38
38
39
39
functionRowList({ children }) {
40
40
return (
41
41
<>
42
-
<h1>Total rows: {Children.count(children)}</h1>
42
+
<h1>Toplam satır: {Children.count(children)}</h1>
43
43
...
44
44
</>
45
45
);
46
46
}
47
47
```
48
48
49
-
[See more examples below.](#counting-children)
49
+
[Aşağıda daha fazla örneğe bakın.](#counting-children)
50
50
51
-
#### Parameters {/*children-count-parameters*/}
51
+
#### Parametreler {/*children-count-parameters*/}
52
52
53
-
*`children`: The value of the [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children)received by your component.
53
+
*`children`: Bileşeniniz tarafından alınan [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children)değeri.
54
54
55
55
#### Returns {/*children-count-returns*/}
56
56
57
-
The number of nodes inside these `children`.
57
+
Bu `children` içindeki node'ların sayısı.
58
58
59
-
#### Caveats {/*children-count-caveats*/}
59
+
#### Uyarılar {/*children-count-caveats*/}
60
60
61
-
-Empty nodes (`null`, `undefined`, and Booleans), strings, numbers, and[React elements](/reference/react/createElement)count as individual nodes. Arrays don't count as individual nodes, but their children do. **The traversal does not go deeper than React elements:**they don't get rendered, and their children aren't traversed. [Fragments](/reference/react/Fragment)don't get traversed.
61
+
-Boş node'lar (`null`, `undefined` ve Booleans), string'ler, sayılar ve[React elemanları](/reference/react/createElement)ayrı node'lar olarak sayılır. Diziler tek tek node'lar olarak sayılmaz, ancak alt elemanları sayılır. **Çaprazlama React öğelerinden daha derine gitmez:**bunlar işlenmez ve alt öğeleri çaprazlanmaz. [Fragments](/reference/react/Fragment)geçilmez.
* `children`: The value of the [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) received by your component.
86
-
* `fn`: The function you want to run for each child, similar to the [array `forEach` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) callback. It will be called with the child as the first argument and its index as the second argument. The index starts at `0` and increments on each call.
87
-
* **optional** `thisArg`: The [`this`value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) with which the `fn` function should be called. If omitted, it's `undefined`.
85
+
* `children`: Bileşeniniz tarafından alınan [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) değeri.
86
+
* `fn`: Her çocuk için çalıştırmak istediğiniz işlev, [array `forEach` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) callback'e benzer. İlk argüman olarak alt eleman ve ikinci argüman olarak indeksi ile çağrılacaktır. İndeks `0`dan başlar ve her çağrıda artar.
87
+
* **isteğe bağlı** `thisArg`: `fn` fonksiyonunun çağrılması gereken [`this`değeri](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this). Atlanırsa, `tanımlanmamış` olur.
88
88
89
89
#### Returns {/*children-foreach-returns*/}
90
90
91
-
`Children.forEach`returns`undefined`.
91
+
`Children.forEach`öğesi`undefined` döndürür.
92
92
93
-
#### Caveats {/*children-foreach-caveats*/}
93
+
#### Uyarılar {/*children-foreach-caveats*/}
94
94
95
-
- Empty nodes (`null`, `undefined`, and Booleans), strings, numbers, and [React elements](/reference/react/createElement) count as individual nodes. Arrays don't count as individual nodes, but their children do. **The traversal does not go deeper than React elements:** they don't get rendered, and their children aren't traversed. [Fragments](/reference/react/Fragment) don't get traversed.
95
+
- Boş node'lar (`null`, `undefined` ve Booleans), string'ler, sayılar ve [React elements](/reference/react/createElement) ayrı node'lar olarak sayılır. Diziler tek tek node'lar olarak sayılmaz, ancak alt elemanları sayılır. **Çaprazlama React öğelerinden daha derine gitmez:** bunlar işlenmez ve alt öğeleri çaprazlanmaz. [Fragments](/referans/react/Fragment) çaprazlanmaz.
Call `Children.map(children, fn, thisArg?)`to map or transform each child in the `children` data structure.
101
+
Alt eleman veri yapısındaki her alt elemani eşlemek veya dönüştürmek için `Children.map(children, fn, thisArg?)`öğesini çağırın.
102
102
103
103
```js src/RowList.js active
104
104
import { Children } from'react';
@@ -116,11 +116,11 @@ function RowList({ children }) {
116
116
}
117
117
```
118
118
119
-
[See more examples below.](#transforming-children)
119
+
[Aşağıda daha fazla örneğe bakınız.](#transforming-children)
120
120
121
121
#### Parameters {/*children-map-parameters*/}
122
122
123
-
* `children`: The value of the [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) received by your component.
123
+
* `children`: Bileşeniniz tarafından alınan [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) değeri.
124
124
* `fn`: The mapping function, similar to the [array `map` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) callback. It will be called with the child as the first argument and its index as the second argument. The index starts at `0` and increments on each call. You need to return a React node from this function. This may be an empty node (`null`, `undefined`, or a Boolean), a string, a number, a React element, or an array of other React nodes.
125
125
* **optional** `thisArg`: The [`this` value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) with which the `fn` function should be called. If omitted, it's `undefined`.
126
126
@@ -141,33 +141,33 @@ Otherwise, returns a flat array consisting of the nodes you've returned from the
141
141
### `Children.only(children)` {/*children-only*/}
142
142
143
143
144
-
Call `Children.only(children)`to assert that `children` represent a single React element.
144
+
Alt elemanların tek bir React öğesini temsil ettiğini doğrulamak için `Children.only(children)`öğesini çağırın.
145
145
146
146
```js
147
147
functionBox({ children }) {
148
148
constelement=Children.only(children);
149
149
// ...
150
150
```
151
151
152
-
#### Parameters {/*children-only-parameters*/}
152
+
#### Parametreler {/*children-only-parameters*/}
153
153
154
-
* `children`: The value of the [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) received by your component.
154
+
* `children`: Bileşeniniz tarafından alınan [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) değeri.
155
155
156
156
#### Returns {/*children-only-returns*/}
157
157
158
-
If`children` [is a valid element,](/reference/react/isValidElement) returns that element.
158
+
Eğer`children` [geçerli bir eleman ise,](/reference/react/isValidElement) bu elemanı döndürür.
159
159
160
-
Otherwise, throws an error.
160
+
Aksi takdirde hata verir.
161
161
162
-
#### Caveats {/*children-only-caveats*/}
162
+
#### Uyarılar {/*children-only-caveats*/}
163
163
164
-
- This method always **throws if you pass an array (such as the return value of `Children.map`) as `children`.** In other words, it enforces that `children` is a single React element, not that it's an array with a single element.
164
+
- Bu yöntem **`children` olarak bir dizi (örneğin, `Children.map`'in dönüş değeri) geçirirseniz her zaman hata fırlatır.** Başka bir deyişle, `children`'ın tek bir React öğesi olmasını zorunlu kılar, ancak bu bir öğe içeren bir dizi olması anlamına gelmez.
* `children`: The value of the [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) received by your component.
183
+
* `children`: Bileşeniniz tarafından alınan [`children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) değeri.
184
184
185
185
#### Returns {/*children-toarray-returns*/}
186
186
187
-
Returns a flat array of elements in `children`.
187
+
`children` içindeki elemanların düz bir dizisini döndürür.
188
188
189
-
#### Caveats {/*children-toarray-caveats*/}
189
+
#### Uyarılar {/*children-toarray-caveats*/}
190
190
191
-
- Empty nodes (`null`, `undefined`, and Booleans) will be omitted in the returned array. **The returned elements' keys will be calculated from the original elements' keys and their level of nesting and position.** This ensures that flattening the array does not introduce changes in behavior.
191
+
- Boş node'lar (`null`, `undefined` ve Booleans) döndürülen dizide atlanacaktır. **Döndürülen öğelerin anahtarları, orijinal öğelerin anahtarlarından, iç içe geçme düzeylerinden ve konumlarından hesaplanacaktır.** Bu, dizinin düzleştirilmesinin davranışta değişikliklere yol açmamasını sağlar.
192
192
193
193
---
194
194
195
-
## Usage {/*usage*/}
195
+
## Kullanım {/*usage*/}
196
196
197
-
### Transforming children {/*transforming-children*/}
To transform the children JSX that your component [receives as the `children` prop,](/learn/passing-props-to-a-component#passing-jsx-as-children) call `Children.map`:
@@ -214,7 +214,7 @@ function RowList({ children }) {
214
214
}
215
215
```
216
216
217
-
In the example above, the `RowList`wraps every child it receives into a `<div className="Row">`container. For example, let's say the parent component passes three `<p>` tags as the `children` prop to `RowList`:
217
+
Yukarıdaki örnekte, `RowList`aldığı her children'ı bir `<div className=“Row”>` konteynerine sarar. Örneğin, ana bileşenin `RowList` öğesine `children` prop'u olarak üç `<p>` etiketi ilettiğini varsayalım:
0 commit comments