We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c44597a commit fe7fae4Copy full SHA for fe7fae4
content/docs/lists-and-keys.md
@@ -52,7 +52,6 @@ ReactDOM.render(
52
53
我们可以把前面的例子重构成一个组件。这个组件接收 `numbers` 数组作为参数,输出一个无序列表。
54
55
-
56
```javascript{3-5,7,13}
57
function NumberList(props) {
58
const numbers = props.numbers;
@@ -109,6 +108,7 @@ const listItems = numbers.map((number) =>
109
108
</li>
110
);
111
```
+
112
一个元素的 key 最好是这个元素在列表中拥有的一个独一无二的字符串。通常,我们使用来自数据的 id 作为元素的 key:
113
114
```js{2}
@@ -173,7 +173,6 @@ ReactDOM.render(
173
174
175
176
177
** 示范:正确的使用键的方式 **
178
179
```javascript{2,3,9,10}
0 commit comments