mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
docs: update react doc link about keys (#49766)
* doc: react doc link Signed-off-by: chenglong <chenglong9604@outlook.com> * Update index.zh-CN.md Signed-off-by: chenglong <chenglong9604@outlook.com> --------- Signed-off-by: chenglong <chenglong9604@outlook.com>
This commit is contained in:
parent
2cf4984b81
commit
282e02705e
@ -84,7 +84,7 @@ Transfer accept `children` to customize render list, using follow props:
|
||||
|
||||
## Warning
|
||||
|
||||
According the [standard](http://facebook.github.io/react/docs/lists-and-keys.html#keys) of React, the key should always be supplied directly to the elements in the array. In Transfer, the keys should be set on the elements included in `dataSource` array. By default, `key` property is used as an unique identifier.
|
||||
According the [standard](https://react.dev/learn/rendering-lists#why-does-react-need-keys) of React, the key should always be supplied directly to the elements in the array. In Transfer, the keys should be set on the elements included in `dataSource` array. By default, `key` property is used as an unique identifier.
|
||||
|
||||
If there's no `key` in your data, you should use `rowKey` to specify the key that will be used for uniquely identify each element.
|
||||
|
||||
|
@ -87,7 +87,7 @@ Transfer 支持接收 `children` 自定义渲染列表,并返回以下参数
|
||||
|
||||
## 注意
|
||||
|
||||
按照 React 的[规范](http://facebook.github.io/react/docs/lists-and-keys.html#keys),所有的组件数组必须绑定 key。在 Transfer 中,`dataSource` 里的数据值需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。
|
||||
按照 React 的[规范](https://zh-hans.react.dev/learn/rendering-lists#why-does-react-need-keys),所有的组件数组必须绑定 key。在 Transfer 中,`dataSource` 里的数据值需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。
|
||||
|
||||
如果你的数据没有这个属性,务必使用 `rowKey` 来指定数据列的主键。
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user