Skip to content

Commit 774548c

Browse files
committed
cloneElement
1 parent 789e84b commit 774548c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/content/reference/react/cloneElement.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Children’larını clone ederek, `List` her bir `Row`’a ekstra bilgi geçireb
137137
</List>
138138
```
139139
140-
Notice how pressing "Next" updates the state of the `List`, and highlights a different row:
140+
“Next” butonuna basıldığında `List`’in state’inin nasıl güncellendiğine ve farklı bir satırın highlight edildiğine dikkat edin:
141141
142142
<Sandpack>
143143
@@ -232,21 +232,21 @@ button {
232232
233233
</Sandpack>
234234
235-
To summarize, the `List` cloned the `<Row />` elements it received and added an extra prop to them.
235+
Özetle, `List` aldığı `<Row />` elementlerini clone etti ve bunlara ekstra bir prop ekledi.
236236
237237
<Pitfall>
238238
239-
Cloning children makes it hard to tell how the data flows through your app. Try one of the [alternatives.](#alternatives)
239+
Children’ları clone etmek, veri akışının uygulamanızda nasıl ilerlediğini anlamayı zorlaştırır. [Alternatiflerden](#alternatives) birini denemeyi deneyin.
240240
241241
</Pitfall>
242242
243243
---
244244
245-
## Alternatives {/*alternatives*/}
245+
## Alternatifler {/*alternatives*/}
246246
247-
### Passing data with a render prop {/*passing-data-with-a-render-prop*/}
247+
### Render prop ile veri aktarımı {/*passing-data-with-a-render-prop*/}
248248
249-
Instead of using `cloneElement`, consider accepting a *render prop* like `renderItem`. Here, `List` receives `renderItem` as a prop. `List` calls `renderItem` for every item and passes `isHighlighted` as an argument:
249+
`cloneElement` kullanmak yerine, `renderItem` gibi bir *render prop* kabul etmeyi düşünebilirsiniz. Burada `List`, `renderItem`’ı bir prop olarak alır. `List`, her item için `renderItem`’ı çağırır ve `isHighlighted`’ı bir argüman olarak geçirir:
250250
251251
```js {1,7}
252252
export default function List({ items, renderItem }) {
@@ -259,7 +259,7 @@ export default function List({ items, renderItem }) {
259259
})}
260260
```
261261
262-
The `renderItem` prop is called a "render prop" because it's a prop that specifies how to render something. For example, you can pass a `renderItem` implementation that renders a `<Row>` with the given `isHighlighted` value:
262+
`renderItem` prop’una "render prop" denir çünkü bir şeyin nasıl render edileceğini belirten bir prop’tur. Örneğin, verilen `isHighlighted` değeri ile bir `<Row>` render eden bir `renderItem` implementasyonu geçebilirsiniz:
263263
264264
```js {3,7}
265265
<List
@@ -274,7 +274,7 @@ The `renderItem` prop is called a "render prop" because it's a prop that specifi
274274
/>
275275
```
276276
277-
The end result is the same as with `cloneElement`:
277+
Sonuç, `cloneElement` kullanımıyla elde edilen ile aynıdır:
278278
279279
```js {4,8,12}
280280
<List>
@@ -293,7 +293,7 @@ The end result is the same as with `cloneElement`:
293293
</List>
294294
```
295295
296-
However, you can clearly trace where the `isHighlighted` value is coming from.
296+
Ancak, `isHighlighted` değerinin nereden geldiğini açıkça takip edebilirsiniz.
297297
298298
<Sandpack>
299299
@@ -389,7 +389,7 @@ button {
389389
390390
</Sandpack>
391391
392-
This pattern is preferred to `cloneElement` because it is more explicit.
392+
Bu desen, `cloneElement`’e göre tercih edilir çünkü daha açıktır.
393393
394394
---
395395

0 commit comments

Comments
 (0)