Skip to content

Commit fd9b9a6

Browse files
author
zhaozhiming
committed
fix: fix codepen docs
1 parent 32294fa commit fd9b9a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

content/docs/lists-and-keys.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ReactDOM.render(
4242
);
4343
```
4444

45-
[在 CodePen 上试试。](https://codepen.io/gaearon/pen/GjPyQr?editors=0011)
45+
[在 CodePen 上尝试](https://codepen.io/gaearon/pen/GjPyQr?editors=0011)
4646

4747
这段代码生成了一个 1 到 5 的数字列表。
4848

@@ -94,7 +94,7 @@ ReactDOM.render(
9494
);
9595
```
9696

97-
[在 CodePen 上试试。](https://codepen.io/gaearon/pen/jrXYRR?editors=0011)
97+
[在 CodePen 上尝试](https://codepen.io/gaearon/pen/jrXYRR?editors=0011)
9898

9999
## Keys {#keys}
100100

@@ -202,7 +202,7 @@ ReactDOM.render(
202202
);
203203
```
204204

205-
[在 CodePen 上试试。](https://codepen.io/gaearon/pen/ZXeOGM?editors=0010)
205+
[在 CodePen 上尝试](https://codepen.io/gaearon/pen/ZXeOGM?editors=0010)
206206

207207
一个好的经验法则是:在 `map()` 方法中的元素需要设置键属性。
208208

@@ -246,7 +246,7 @@ ReactDOM.render(
246246
);
247247
```
248248

249-
[在 CodePen 上试试。](https://codepen.io/gaearon/pen/NRZYGN?editors=0010)
249+
[在 CodePen 上尝试](https://codepen.io/gaearon/pen/NRZYGN?editors=0010)
250250

251251
key 会传递信息给 React ,但不会传递给你的组件。如果你的组件中需要使用 `key` 属性的值,请用其他属性名显式传递这个值:
252252

@@ -296,6 +296,6 @@ function NumberList(props) {
296296
}
297297
```
298298

299-
[在 CodePen 上试试。](https://codepen.io/gaearon/pen/BLvYrB?editors=0010)
299+
[在 CodePen 上尝试](https://codepen.io/gaearon/pen/BLvYrB?editors=0010)
300300

301301
这么做有时可以使你的代码更清晰,但有时这种风格也会被滥用。就像在 JavaScript 中一样,何时需要为了可读性提取出一个变量,这完全取决于你。但请记住,如果一个 `map()` 嵌套了太多层级,那可能就是你 [提取出组件](/docs/components-and-props.html#extracting-components) 的一个好时机。

0 commit comments

Comments
 (0)