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
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>`.
This example renders a famous haiku by Tachibana Hokushi, with each line wrapped in a `<p>` tag. Your job is to insert an `<hr />` separator between each paragraph. Your resulting structure should look like this:
ອີກວິທີໜຶ່ງ, ທ່ານສາມາດສະແດງຜົນ collection ຂອງ fragment ທີ່ປະກອບມີ `<hr />` and `<p>...</p>`. ເຖິງຢ່າງໃດກໍຕາມ, syntax `<>...</>` ບໍ່ຮອງຮັບການສົ່ງຜ່ານ key, ດັ່ງນັ້ນທ່ານຕ້ອງໄດ້ຂຽນ `<Fragment>` ຢ່າງຊັດເຈນ:
1221
-
=======
1222
-
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:
1223
-
>>>>>>> 3563d95efe8719bdae8bbd258e6ab4134753348b
1224
1214
1225
1215
<Sandpack>
1226
1216
@@ -1266,11 +1256,8 @@ hr {
1266
1256
1267
1257
</Sandpack>
1268
1258
1269
-
<<<<<<< HEAD
1270
1259
ຈື່ໄວ້ວ່າ, fragment (ມັກຂຽນເປັນ `<> </>`) ໃຫ້ທ່ານ group JSX node ໂດຍບໍ່ຕ້ອງເພີ່ມ `<div>`!
1271
-
=======
1272
-
Remember, Fragments (often written as `<> </>`) let you group JSX nodes without adding extra `<div>`s!
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:
377
-
>>>>>>> 3563d95efe8719bdae8bbd258e6ab4134753348b
378
371
379
372
```js {3-6}
380
373
exportdefaultfunctionSquare() {
@@ -1182,11 +1175,8 @@ Too many re-renders. React limits the number of renders to prevent an infinite l
You could fix this by creating a function like `handleFirstSquareClick` that calls `handleClick(0)`, a function like `handleSecondSquareClick` that calls `handleClick(1)`, and so on. You would pass (rather than call) these functions down as props like `onSquareClick={handleFirstSquareClick}`. This would solve the infinite loop.
@@ -2088,17 +2078,7 @@ export default function Game() {
2088
2078
}
2089
2079
```
2090
2080
2091
-
<<<<<<< HEAD
2092
2081
ທ່ານສາມາດເບິ່ງໄດ້ວ່າ code ຂອງທ່ານຄວນເປັນແນວໃດໃນດ້ານລຸ່ມນີ້. ສັງເກດວ່າທ່ານຄວນເຫັນຂໍ້ຜິດພາດໃນ console developer tools ທີ່ບອກວ່າ: ``Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Game`.`` ທ່ານຈະແປງຂໍ້ຜິດພາດນີ້ໃນຫົວຂໍ້ຕໍ່ໄປ.
2093
-
=======
2094
-
You can see what your code should look like below. Note that you should see an error in the developer tools console that says:
2095
-
2096
-
<ConsoleBlock level="warning">
2097
-
Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Game`.
In addition to the updated counts, a human reading this would probably say that you swapped Alexa and Ben's ordering and inserted Claudia between Alexa and Ben. However, React is a computer program and does not know what you intended, so you need to specify a _key_ property for each list item to differentiate each list item from its siblings. If your data was from a database, Alexa, Ben, and Claudia's database IDs could be used as keys.
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/components/input.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ To display an input, render the [built-in browser `<input>`](https://developer.m
34
34
35
35
<Canary>
36
36
37
-
React's extensions to the `formAction` prop are currently only available in React's Canary and experimental channels. In stable releases of React, `formAction` works only as a [built-in browser HTML component](/reference/react-dom/components#all-html-components). Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
37
+
38
+
React's extensions to the `formAction` prop are currently only available in React's Canary and experimental channels. In stable releases of React `formAction` works only as a [built-in browser HTML component](https://react.dev/reference/react-dom/components#all-html-components). Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
0 commit comments