Skip to content

Commit 9d6e639

Browse files
authored
Merge pull request #56 from reactjs/sync-6570e6cd
Sync with react.dev @ 6570e6c
2 parents 61ed0f8 + 46d5a35 commit 9d6e639

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/content/learn/conditional-rendering.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,11 @@ export default function PackingList() {
626626
627627
ສັງເກດທ່ານຕ້ອງຂຽນ `importance > 0 && ...` ແທນທີ່ຈະເປັນ `importance && ...` ສະນັ້ນຫາກ `importance` ເປັນ `0`, ຜົນລັບຈະບໍ່ສະແດງ `0`!
628628
629+
<<<<<<< HEAD
629630
ໃນວິທີການນີ້, ຈະໃຊ້ເງື່ອນໄຂສອງເງື່ອນໄຂແຍກກັນເພື່ອໃສ່ຊ່ອງວ່າງລະຫວ່າງຊື່ ແລະ label. ອີກວິທີໜຶ່ງ, ທ່ານສາມາດໃຊ້ fragment ທີ່ມີຊ່ອງວ່າງນຳໜ້າ: `importance > 0 && <> <i>...</i></>` ຫຼື ເພີ່ມຊ່ອງວ່າງພາຍໃນ `importance > 0 && <> <i>...</i></>`.
631+
=======
632+
In this solution, two separate conditions are used to insert a space between the name and the importance label. Alternatively, you could use a Fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
633+
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
630634
631635
</Solution>
632636

src/content/learn/rendering-lists.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,11 @@ hr {
11461146

11471147
<Hint>
11481148

1149+
<<<<<<< HEAD
11491150
ທ່ານຈະຕ້ອງແປງ `map` ເປັນ loop ດ້ວຍໂຕເອງ, ຫຼື ໃຊ້ fragment.
1151+
=======
1152+
You'll either need to convert `map` to a manual loop, or use a Fragment.
1153+
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
11501154
11511155

11521156
</Hint>
@@ -1210,7 +1214,11 @@ hr {
12101214

12111215
ການໃຊ້ index ແຖວເກົ່າເປັນ `key` ບໍ່ເຮັດວຽກອີກຕໍ່ໄປເພາະວ່າແຕ່ລະໂຕຂັ້ນ ແລະ ຫຍໍ້ໜ້າແຕ່ລະໂຕຢູ່ໃນ array ດຽວກັນ. ເຖິງຢ່າງໃດກໍຕາມ, ທ່ານສາມາດກຳນົດ key ທີ່ແຕກຕ່າງກັນໃຫ້ແຕ່ລະລາຍການໄດ້ໂດຍໃຊ້ຄຳຕໍ່ທ້າຍເຊັ່ນ `key={i + '-text'}`.
12121216

1217+
<<<<<<< HEAD
12131218
ອີກວິທີໜຶ່ງ, ທ່ານສາມາດສະແດງຜົນ collection ຂອງ fragment ທີ່ປະກອບມີ `<hr />` and `<p>...</p>`. ເຖິງຢ່າງໃດກໍຕາມ, syntax `<>...</>` ບໍ່ຮອງຮັບການສົ່ງຜ່ານ key, ດັ່ງນັ້ນທ່ານຕ້ອງໄດ້ຂຽນ `<Fragment>` ຢ່າງຊັດເຈນ:
1219+
=======
1220+
Alternatively, you could render a collection of Fragments which contain `<hr />` and `<p>...</p>`. However, the `<>...</>` shorthand syntax doesn't support passing keys, so you'd have to write `<Fragment>` explicitly:
1221+
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
12141222
12151223
<Sandpack>
12161224

@@ -1256,7 +1264,11 @@ hr {
12561264

12571265
</Sandpack>
12581266

1267+
<<<<<<< HEAD
12591268
ຈື່ໄວ້ວ່າ, fragment (ມັກຂຽນເປັນ `<> </>`) ໃຫ້ທ່ານ group JSX node ໂດຍບໍ່ຕ້ອງເພີ່ມ `<div>`!
1269+
=======
1270+
Remember, Fragments (often written as `<> </>`) let you group JSX nodes without adding extra `<div>`s!
1271+
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
12601272
12611273

12621274
</Solution>

src/content/learn/tutorial-tic-tac-toe.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ export default function Square() {
367367

368368
</ConsoleBlock>
369369

370+
<<<<<<< HEAD
370371
Component React ຕ້ອງການ return ໜຶ່ງ JSX element ແລະ ບໍ່ສາມາດສົ່ງ JSX ທີ່ຕິດພັນຫຼາຍອັນເຊັ່ນ ສອງປຸ່ມກົດ. ເພື່ອແກ້ໄຂບັນຫານີ້ທ່ານສາມາດໃຊ້ *fragments* (`<>` ແລະ `</>`) ເພື່ອລວມ JSX ທີ່ຕິດພັນຫຼາຍອັນດັ່ງນີ້:
372+
=======
373+
React components need to return a single JSX element and not multiple adjacent JSX elements like two buttons. To fix this you can use *Fragments* (`<>` and `</>`) to wrap multiple adjacent JSX elements like this:
374+
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
371375
372376
```js {3-6}
373377
export default function Square() {

0 commit comments

Comments
 (0)