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

Rendering from a list of data #40

Open
borgogelli opened this issue Jun 17, 2019 · 3 comments
Open

Rendering from a list of data #40

borgogelli opened this issue Jun 17, 2019 · 3 comments

Comments

@borgogelli
Copy link

When I use the map function to render the component (see the code below) I get the following error: Invariant Violation: input range must be monotonically non-decreasing

  return (
      <ParallaxSwiper
        speed={0.5}
        animatedValue={this.myCustomAnimatedValue}
        dividerWidth={8}
        dividerColor="black"
        backgroundColor="black"
        onMomentumScrollEnd={activePageIndex => console.log(activePageIndex)}
        showProgressBar={true}
        progressBarBackgroundColor="rgba(0,0,0,0.25)"
        progressBarValueBackgroundColor="white"
      >
      {this.props.images.map((image) => (
      <ParallaxSwiperPage key={image.id} 
                    BackgroundComponent={
                      <Image style={styles.backgroundImage}
                        source={{ uri: image.uri }}
                      />
                    }                     
                  />                 
          ))
      } 
      </ParallaxSwiper>
    );
@zachgibson
Copy link
Owner

If you make an Expo Snack I can take a look at it.

@nickmccomb
Copy link

nickmccomb commented Nov 7, 2019

@borgogelli you forgot to return the ParralaxSwiperPage items from the map function

@dhirajanand014
Copy link

When I use the map function to render the component (see the code below) I get the following error: Invariant Violation: input range must be monotonically non-decreasing

  return (
      <ParallaxSwiper
        speed={0.5}
        animatedValue={this.myCustomAnimatedValue}
        dividerWidth={8}
        dividerColor="black"
        backgroundColor="black"
        onMomentumScrollEnd={activePageIndex => console.log(activePageIndex)}
        showProgressBar={true}
        progressBarBackgroundColor="rgba(0,0,0,0.25)"
        progressBarValueBackgroundColor="white"
      >
      {this.props.images.map((image) => (
      <ParallaxSwiperPage key={image.id} 
                    BackgroundComponent={
                      <Image style={styles.backgroundImage}
                        source={{ uri: image.uri }}
                      />
                    }                     
                  />                 
          ))
      } 
      </ParallaxSwiper>
    );

Please remove showProgressBar={true}

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

4 participants