question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pagnization does not work with dynamic components

See original GitHub issue

Which OS ?

iOS

Version

Which versions are you using:

  • react-native-swiper v1.5.6
  • react-native v0.49

Expected behavior

Pagnization dots indicate current swipe-item’s index

Actual behavior

only the first dot is highlighted

I have tried to use a few hard-coded mock CardResume and the paganization works fine with correct indication, but once I switch to using map the paganization indicators stopped working

  ```
   <Swiper
      style={{}}
      height={height*0.7}>

      {this.state.resumeList.map((resumePreview, index) => {
        this.fakedata.resumeName = resumePreview.headline
        return (
          <CardResume 
            key={index}
            style={{margin: "5%"}}
            data={this.fakedata}
            onPress={() => this.props.navigation.navigate('Details', { resumeID: resumePreview.profile_id })}
          />
        )
      })}
    </Swiper>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:20

github_iconTop GitHub Comments

9reactions
joe-lzcommented, Jan 31, 2018

I did just like this and it works fine image

5reactions
aaronSigcommented, Sep 8, 2019

It looks like the problem is the swiper component isn’t resetting when the slides change.

Setting the key on the swiper to change (e.g. key={images.length}) when the underlying array changes also fixes this:

 <Swiper key={images.length}>
          {images.map(image => (
                 <Image source={image} />
          ))}
</Swiper>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic page pagination is not working in react table
If that's really what you want and your problem is the non-displayed values, it works by changing MenuItem to option , with both...
Read more >
Dot does not work properly while rendering dynamic array ...
while rendering dynamic components(eg. rendering screens in an array or use map) active dot will remain at the initial position no matter which ......
Read more >
Pagination - Bootstrap
Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping <nav> element to...
Read more >
How To Build a Reusable Pagination Component with Vue.js
These will be our dynamic props. Although we want to render a range of pages, we do not want to render all available...
Read more >
Dynamic Query Component - Bloomreach
Class Name; Purpose; Component Parameters; Component request parameters; Pagination Attributes; Page Attributes. This feature is available since Bloomreach ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found