Skip to content

Commit

Permalink
Merge pull request #56 from reactjs/sync-6570e6cd
Browse files Browse the repository at this point in the history
Sync with react.dev @ 6570e6c
  • Loading branch information
TheBrown authored Jan 28, 2024
2 parents 61ed0f8 + 46d5a35 commit 9d6e639
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/content/learn/conditional-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ export default function PackingList() {
ສັງເກດທ່ານຕ້ອງຂຽນ `importance > 0 && ...` ແທນທີ່ຈະເປັນ `importance && ...` ສະນັ້ນຫາກ `importance` ເປັນ `0`, ຜົນລັບຈະບໍ່ສະແດງ `0`!
<<<<<<< HEAD
ໃນວິທີການນີ້, ຈະໃຊ້ເງື່ອນໄຂສອງເງື່ອນໄຂແຍກກັນເພື່ອໃສ່ຊ່ອງວ່າງລະຫວ່າງຊື່ ແລະ label. ອີກວິທີໜຶ່ງ, ທ່ານສາມາດໃຊ້ fragment ທີ່ມີຊ່ອງວ່າງນຳໜ້າ: `importance > 0 && <> <i>...</i></>` ຫຼື ເພີ່ມຊ່ອງວ່າງພາຍໃນ `importance > 0 && <> <i>...</i></>`.
=======
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>`.
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
</Solution>
Expand Down
12 changes: 12 additions & 0 deletions src/content/learn/rendering-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,11 @@ hr {

<Hint>

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

</Hint>
Expand Down Expand Up @@ -1210,7 +1214,11 @@ hr {

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

<<<<<<< HEAD
ອີກວິທີໜຶ່ງ, ທ່ານສາມາດສະແດງຜົນ collection ຂອງ fragment ທີ່ປະກອບມີ `<hr />` and `<p>...</p>`. ເຖິງຢ່າງໃດກໍຕາມ, syntax `<>...</>` ບໍ່ຮອງຮັບການສົ່ງຜ່ານ key, ດັ່ງນັ້ນທ່ານຕ້ອງໄດ້ຂຽນ `<Fragment>` ຢ່າງຊັດເຈນ:
=======
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:
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
<Sandpack>

Expand Down Expand Up @@ -1256,7 +1264,11 @@ hr {

</Sandpack>

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

</Solution>
Expand Down
4 changes: 4 additions & 0 deletions src/content/learn/tutorial-tic-tac-toe.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ export default function Square() {

</ConsoleBlock>

<<<<<<< HEAD
Component React ຕ້ອງການ return ໜຶ່ງ JSX element ແລະ ບໍ່ສາມາດສົ່ງ JSX ທີ່ຕິດພັນຫຼາຍອັນເຊັ່ນ ສອງປຸ່ມກົດ. ເພື່ອແກ້ໄຂບັນຫານີ້ທ່ານສາມາດໃຊ້ *fragments* (`<>` ແລະ `</>`) ເພື່ອລວມ JSX ທີ່ຕິດພັນຫຼາຍອັນດັ່ງນີ້:
=======
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:
>>>>>>> 6570e6cd79a16ac3b1a2902632eddab7e6abb9ad
```js {3-6}
export default function Square() {
Expand Down

0 comments on commit 9d6e639

Please sign in to comment.