alexbrillant / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
1.55k stars 462 forks source link

Error with infinite true and cardIndex set to last index #220

Closed nirazan1 closed 5 years ago

nirazan1 commented 5 years ago

here is the scenario,

     <Swiper
        cards={['DO', 'MORE', 'OF', 'WHAT', 'MAKES', 'YOU', 'HAPPY']}
        renderCard={(card) => {
            return (
                <View style={styles.card}>
                    <Text style={styles.text}>{card}</Text>
                </View>
            )
        }}
        onSwiped={(cardIndex) => {console.log(cardIndex)}}
        onSwipedAll={() => {console.log('onSwipedAll')}}
        infinite={true}
        cardIndex={6}
        backgroundColor={'#4FD0E9'}
        stackSize= {3}>
        <Button
          onPress={() => {console.log('oulala')}}
          title="Press me">
          You can press me
        </Button>
      </Swiper>

on swipe right , i'm expecting to see the first card i.e. 'DO', instead i get following error: image

any suggestions ?

webraptor commented 5 years ago

What environment / RNDS version are you using?

nirazan1 commented 5 years ago

What environment / RNDS version are you using?

Development, Version 1.5.26

"react-native-deck-swiper": {
      "version": "1.5.26",
      "resolved": "https://registry.npmjs.org/react-native-deck-swiper/-/react-native-deck-swiper-1.5.26.tgz",
      "integrity": "sha512-6sB1T0EDlrZ4SSxL2qUOltq5ufhBXQ9I0ZvflmkO6k+zDOtGJ0BoFnVSfdjIuXnfVpdZVdSHQmpKtDmtIxPzmQ==",
      "requires": {
        "prop-types": "15.5.10"
      },
      "dependencies": {
        "prop-types": {
          "version": "15.5.10",
          "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.10.tgz",
          "integrity": "sha1-J5ffwxJhguOpXj37suiT3ddFYVQ=",
          "requires": {
            "fbjs": "^0.8.9",
            "loose-envify": "^1.3.1"
          }
        }
      }
    }
webraptor commented 5 years ago

Please upgrade to latest version 1.6.4. With respect to the environment, more like react-native and react version than, development :)

nirazan1 commented 5 years ago

Thanks, update worked , sorry my forté is Ruby on Rails, environment means development/production on it 😅. Thanks again !