GithubHelp home page GithubHelp logo

Comments (3)

oxyii avatar oxyii commented on June 1, 2024

@chayancbnits Pagination? You mean manual triggering slides changing? Or custom numeric dots? If custom dots then you must implement DotComponent prop. Something like this:

<Swiper
  controlsProps={{
    dotsTouchable: true, // <- pass onPress prop func to your DotComponent ?
    DotComponent: ({ onPress, index, isActive }) => (
      <Text style={isActive ? styles.activeDot : styles.dot} onPress={onPress}>
        {index+1}
      </Text>
    ),
  }}
>
  <View slide1 />
  <View slide2 />
</Swiper>

and if manual triggering:

export default SomeComponentClass extends React.Component {
  swiperRef;

  render() {
    return (
      <View>
        <Swiper ref={swiperInstance => this.swiperRef = swiperInstance}>
          <View slide1 />
          <View slide2 />
          <View slide3 />
        </Swiper>
        <Button
          onPress={() => this.swiperRef && this.swiperRef.goTo(2)}
          title="go to third"
        />
      </View>
    );
  }
}

from react-native-web-swiper.

chayancbnits avatar chayancbnits commented on June 1, 2024

Pagination is the process of separating print or digital content into discrete pages. For print documents and some online content, pagination also refers to the automated process of adding consecutive numbers to identify the sequential order of pages.

For example I have total 50 items, At first time I have to show 10 items show for swipe , when I have to swiped each items, when I have swipe 9th number item for show 10th number item and as well as a rest API call for next 11 to 20 item get from sever and appended previous items.

1_6727j2BrMrfiAqdzSEezdg

from react-native-web-swiper.

oxyii avatar oxyii commented on June 1, 2024

@chayancbnits sorry but this swiper is not suitable for your tasks. And lazy loading is not planned at all because it will entail a whole set of functionality and a lot of errors that are so far from the functionality of the swiper. E.g. including VirtualizedList. Without it, loading will be slower with each iteration... I am not ready to support all this )))
You can use RN components such a FlatList and adjust the scroll position based on touch events. ScrollView props already built in FlatList. So you can try to use ScrollView's touches props inside FlatList. leecade's react-native-swiper src can helps.

from react-native-web-swiper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.