problem
this.props.key
in the component will get undefined
.
the reason
Most of the props on JSX elements will be passed to the component, but there are two special props ( ref
and key
) that have been used by React and will not be passed to the component.
solution
<ListItem key={result.id} id={result.id} />
with a different prop. Although this may seem redundant, it is important to separate application logic from reconciliation hints.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。