Skip to content

Commit fe3fcae

Browse files
committed
cloneElement
1 parent 6676154 commit fe3fcae

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
@@ -403,7 +403,7 @@ Bu desen, `cloneElement`’e göre tercih edilir çünkü daha açıktır.
403403
export const HighlightContext = createContext(false);
404404
```
405405
406-
Your `List` component can wrap every item it renders into a `HighlightContext` provider:
406+
`List` bileşeniniz, render ettiği her bir öğeyi bir `HighlightContext` sağlayıcısı içine sarabilir:
407407
408408
```js {8,10}
409409
export default function List({ items, renderItem }) {
@@ -420,15 +420,15 @@ export default function List({ items, renderItem }) {
420420
})}
421421
```
422422
423-
With this approach, `Row` does not need to receive an `isHighlighted` prop at all. Instead, it reads the context:
423+
Bu yaklaşımla, `Row` bileşeninin artık bir `isHighlighted` prop’u almasına gerek yoktur. Bunun yerine, context’i okur:
424424
425425
```js src/Row.js {2}
426426
export default function Row({ title }) {
427427
const isHighlighted = useContext(HighlightContext);
428428
// ...
429429
```
430430
431-
This allows the calling component to not know or worry about passing `isHighlighted` to `<Row>`:
431+
Bu, çağıran bileşenin `<Row>` bileşenine `isHighlighted` prop’unu geçmek zorunda kalmamasını ve bununla ilgilenmemesini sağlar:
432432
433433
```js {4}
434434
<List
@@ -439,7 +439,7 @@ This allows the calling component to not know or worry about passing `isHighligh
439439
/>
440440
```
441441
442-
Instead, `List` and `Row` coordinate the highlighting logic through context.
442+
Bunun yerine, `List` ve `Row`, highlight (vurgulama) mantığını context üzerinden koordine eder:
443443
444444
<Sandpack>
445445
@@ -549,13 +549,13 @@ button {
549549
550550
</Sandpack>
551551
552-
[Learn more about passing data through context.](/reference/react/useContext#passing-data-deeply-into-the-tree)
552+
[Context aracılığıyla veri aktarma hakkında daha fazla bilgi edinin.](/reference/react/useContext#passing-data-deeply-into-the-tree)
553553
554554
---
555555
556-
### Extracting logic into a custom Hook {/*extracting-logic-into-a-custom-hook*/}
556+
### Mantığı özel bir Hook içine çıkarma {/*extracting-logic-into-a-custom-hook*/}
557557
558-
Another approach you can try is to extract the "non-visual" logic into your own Hook, and use the information returned by your Hook to decide what to render. For example, you could write a `useList` custom Hook like this:
558+
Deneyebileceğiniz bir diğer yaklaşım, "görsel olmayan" mantığı kendi Hook’unuza çıkarmak ve Hook’unuzun döndürdüğü bilgilere göre neyin render edileceğine karar vermektir. Örneğin, aşağıdaki gibi bir `useList` özel Hook’u yazabilirsiniz:
559559
560560
```js
561561
import { useState } from 'react';
@@ -574,7 +574,7 @@ export default function useList(items) {
574574
}
575575
```
576576
577-
Then you could use it like this:
577+
Ardından bunu şu şekilde kullanabilirsiniz:
578578
579579
```js {2,9,13}
580580
export default function App() {
@@ -597,7 +597,7 @@ export default function App() {
597597
}
598598
```
599599
600-
The data flow is explicit, but the state is inside the `useList` custom Hook that you can use from any component:
600+
Veri akışı nettir (explicit), ancak state `useList` custom Hook’unun içindedir ve bunu herhangi bir bileşenden kullanabilirsiniz:
601601
602602
<Sandpack>
603603
@@ -690,4 +690,4 @@ button {
690690
691691
</Sandpack>
692692
693-
This approach is particularly useful if you want to reuse this logic between different components.
693+
Bu yaklaşım, bu mantığı farklı bileşenler arasında yeniden kullanmak istediğiniz durumlarda özellikle faydalıdır.

0 commit comments

Comments
 (0)