【发布时间】:2017-06-27 04:01:23
【问题描述】:
https://codesandbox.io/s/qYEvQEl0
我尝试渲染一个可拖动列表,一切似乎都很好,只是我不知道如何将“索引”传递给 rowRenderer
如果我做rowRenderer=props => <Row {...props}/>,index 会成功传入。
但如果我这样做:
const SortableRow = SortableElement(Row)
rowRenderer=props => <SortableRow {...props}/>,
index 以某种方式被阻止,未能传递到<Row/>
基本上,我不明白当您使用 HOC 包装您的 <Row/> 组件时会出现什么问题?为什么有些道具可以通过,有些则不能?
【问题讨论】: