react-native-card-stack-swiper
react-native-card-stack-swiper copied to clipboard
Warning: Failed prop type: Invalid prop `children` supplied to `CardStack`.
Getting this error
<CardStack
loop
initialIndex={0}
verticalSwipe={false}
renderNoMoreCards={() => !loading && (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text style={{ fontWeight: '700', fontSize: 18, color: 'gray' }}>No more cards :(</Text>
</View>
)}
ref={swiper}
style={{ flex: 1 }}
onSwipedRight={onSwipedRight}
onSwipedLeft={onSwipedLeft}
>
{!loading && cards.map((item, index) => (
<Card key={item.id}>
<CardItem
hasActions
imageUrl={item.imageUrl}
name={item.title}
description={item.description}
score={item.score}
swiper={swiper}
/>
</Card>
)}
</CardStack>
@mrosendin did you find out what was causing this?
@mrosendin did you find out what was causing this?
No, I'm now using react-native-deck-swiper
I fixed by extending the type declaration and adding an optional children props