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
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:
424
424
425
425
```js src/Row.js {2}
426
426
exportdefaultfunctionRow({ title }) {
427
427
constisHighlighted=useContext(HighlightContext);
428
428
// ...
429
429
```
430
430
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:
432
432
433
433
```js {4}
434
434
<List
@@ -439,7 +439,7 @@ This allows the calling component to not know or worry about passing `isHighligh
439
439
/>
440
440
```
441
441
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:
443
443
444
444
<Sandpack>
445
445
@@ -549,13 +549,13 @@ button {
549
549
550
550
</Sandpack>
551
551
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)
553
553
554
554
---
555
555
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*/}
557
557
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:
559
559
560
560
```js
561
561
import { useState } from'react';
@@ -574,7 +574,7 @@ export default function useList(items) {
574
574
}
575
575
```
576
576
577
-
Then you could use it like this:
577
+
Ardından bunu şu şekilde kullanabilirsiniz:
578
578
579
579
```js {2,9,13}
580
580
exportdefaultfunctionApp() {
@@ -597,7 +597,7 @@ export default function App() {
597
597
}
598
598
```
599
599
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:
601
601
602
602
<Sandpack>
603
603
@@ -690,4 +690,4 @@ button {
690
690
691
691
</Sandpack>
692
692
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