Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Failed prop type: Invalid prop children supplied to CardStack. #101

Open
mrosendin opened this issue May 31, 2023 · 3 comments
Open

Comments

@mrosendin
Copy link

mrosendin commented May 31, 2023

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>
@Theeeus
Copy link

Theeeus commented Nov 8, 2024

@mrosendin did you find out what was causing this?

@mrosendin
Copy link
Author

@mrosendin did you find out what was causing this?

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

@Theeeus
Copy link

Theeeus commented Nov 8, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants