Skip to content

Commit 06111c9

Browse files
committed
translate second challenge
1 parent ae45995 commit 06111c9

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/content/learn/preserving-and-resetting-state.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,15 +1415,15 @@ Bu şekilde `Form` her zaman ikinci alt elemandır yani her zaman aynı konumdad
14151415
14161416
</Solution>
14171417
1418-
#### Swap two form fields {/*swap-two-form-fields*/}
1418+
#### İki form alanını değiştir {/*swap-two-form-fields*/}
14191419
1420-
This form lets you enter first and last name. It also has a checkbox controlling which field goes first. When you tick the checkbox, the "Last name" field will appear before the "First name" field.
1420+
Bu form ad ve soyadınızı girmenize izin verir. Aynı zamanda hangi alanın daha önce geleceğini kontrol eden kutucuk vardır. Kutucuğu işaretlediğiniz zaman "Soyad" alanı "Ad" alanından önce gelecektir.
14211421
1422-
It almost works, but there is a bug. If you fill in the "First name" input and tick the checkbox, the text will stay in the first input (which is now "Last name"). Fix it so that the input text *also* moves when you reverse the order.
1422+
Neredeyse çalışmakta ancak bir hata var. Eğer "Ad" input'unu doldurup kutucuğu işaretlerseniz, adınız ilk input'ta kalacaktır (artık "Soyad" olan input). Sırayı değiştirdiğinzde input metninin de değişeceği şekilde düzenleyin.
14231423
14241424
<Hint>
14251425
1426-
It seems like for these fields, their position within the parent is not enough. Is there some way to tell React how to match up the state between re-renders?
1426+
Görünüşe göre bu alanlar için üst eleman içindeki konumları yeterli değildir. React'e yeniden render'lar arasında state'leri nasıl eşleştireceğini söylemenin bir yolu var mı?
14271427
14281428
</Hint>
14291429
@@ -1441,22 +1441,22 @@ export default function App() {
14411441
checked={reverse}
14421442
onChange={e => setReverse(e.target.checked)}
14431443
/>
1444-
Reverse order
1444+
Sırayı terse çevir
14451445
</label>
14461446
);
14471447
if (reverse) {
14481448
return (
14491449
<>
1450-
<Field label="Last name" />
1451-
<Field label="First name" />
1450+
<Field label="Ad" />
1451+
<Field label="Soyad" />
14521452
{checkbox}
14531453
</>
14541454
);
14551455
} else {
14561456
return (
14571457
<>
1458-
<Field label="First name" />
1459-
<Field label="Last name" />
1458+
<Field label="Ad" />
1459+
<Field label="Soyad" />
14601460
{checkbox}
14611461
</>
14621462
);
@@ -1487,7 +1487,7 @@ label { display: block; margin: 10px 0; }
14871487
14881488
<Solution>
14891489
1490-
Give a `key` to both `<Field>` components in both `if` and `else` branches. This tells React how to "match up" the correct state for either `<Field>` even if their order within the parent changes:
1490+
`if` ve `else` dallarındaki her iki `<Field>` bileşenine `anahtar` (`key`) verin. Bu, React'e her iki `<Field>` bileşeni için üst elemandaki sıraları değişse bile doğru state'i nasıl "eşleştireceğini" söyler.
14911491
14921492
<Sandpack>
14931493
@@ -1503,22 +1503,22 @@ export default function App() {
15031503
checked={reverse}
15041504
onChange={e => setReverse(e.target.checked)}
15051505
/>
1506-
Reverse order
1506+
Sırayı ters çevir
15071507
</label>
15081508
);
15091509
if (reverse) {
15101510
return (
15111511
<>
1512-
<Field key="lastName" label="Last name" />
1513-
<Field key="firstName" label="First name" />
1512+
<Field key="lastName" label="Ad" />
1513+
<Field key="firstName" label="Soyad" />
15141514
{checkbox}
15151515
</>
15161516
);
15171517
} else {
15181518
return (
15191519
<>
1520-
<Field key="firstName" label="First name" />
1521-
<Field key="lastName" label="Last name" />
1520+
<Field key="firstName" label="Ad" />
1521+
<Field key="lastName" label="Soyad" />
15221522
{checkbox}
15231523
</>
15241524
);

0 commit comments

Comments
 (0)