【发布时间】:2018-06-30 19:05:12
【问题描述】:
我需要创建自定义列表项的轮播,并且我已经将轮播组件库之一(react-native-snap-carousel)导入到项目中,但是轮播组件需要返回我们需要的组件的道具呈现为轮播 itemList。 所以我发送这样的道具
[carousel {:render-item (fn [] [my-custom-item])
...otherprops... }]
但是这条消息出错了
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
如何将道具作为返回元素的函数发送?
这是在js上调用轮播组件的方法
<Carousel
ref={(c) => { this._carousel = c; }}
data={this.state.entries}
renderItem={this._renderItem}
sliderWidth={sliderWidth}
itemWidth={itemWidth}
/>
【问题讨论】:
标签: carousel clojurescript reagent