React-native-deck-swiper: ref is not working

Created on 24 Feb 2018  路  1Comment  路  Source: alexbrillant/react-native-deck-swiper

ref is not working. Its returning undefined

 <Swiper
          ref={swiper => {
            this.swiper = swiper;
          }}
          cards={this.state.cards}
          renderCard={card => {
            return <Card {...card} />;
          }}
          onSwipedAll={() => {
            console.log("onSwipedAll");
          }}
          cardIndex={0}
          backgroundColor={"#fff"}
          cardVerticalMargin={0}
          cardHorizontalMargin={0}
          childrenOnTop={false}
          horizontalThreshold={200}
/>

Most helpful comment

Instead of this.refs.swiper try calling this.swiper

>All comments

Instead of this.refs.swiper try calling this.swiper

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lsps9150414 picture lsps9150414  路  7Comments

georgeMorales picture georgeMorales  路  4Comments

Shubh1692 picture Shubh1692  路  8Comments

acesetmatch picture acesetmatch  路  8Comments

deadcoder0904 picture deadcoder0904  路  6Comments