react-native-card-stack-swiper icon indicating copy to clipboard operation
react-native-card-stack-swiper copied to clipboard

Warning: Failed prop type: Invalid prop `children` supplied to `CardStack`.

Open mrosendin opened this issue 2 years ago • 3 comments

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 avatar May 31 '23 20:05 mrosendin

@mrosendin did you find out what was causing this?

Theeeus avatar Nov 08 '24 01:11 Theeeus

@mrosendin did you find out what was causing this?

No, I'm now using react-native-deck-swiper

mrosendin avatar Nov 08 '24 02:11 mrosendin

@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

Theeeus avatar Nov 08 '24 02:11 Theeeus