我在视图中使用 NativeBase 的 DeckSwiper (docs,code),每次都会出错:
Warning: React.createElement: type should not be null, undefined,
boolean, or number. It should be a string (for DOM elements) or a
ReactClass (for composite components). Check the render method of `CardSwiper`.
此标记有效:
<View flex>
<DeckSwiper dataSource={cards} renderItem={(item) => {
console.log(item);
return (
<Text flex>{item.text}</Text>
)
}}/>
但是在这个标记中为Text
(来自他们的站点)替换失败,出现上述错误:
<Card style={{
elevation: 3
}}>
<CardItem>
<Thumbnail source={item.image}/>
<Text>{item.text}</Text>
<Text note>NativeBase</Text>
</CardItem>
<CardItem>
<Image style={{
resizeMode: 'cover',
width: null
}} source={item.image}/>
</CardItem>
<CardItem>
<Icon name="ios-heart" style={{
color: '#ED4A6A'
}}/>
<Text>{item.name}</Text>
</CardItem>
</Card>
我不知道是我用错了还是文档关闭了,或者这是一个错误。这里有什么问题?