leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.41k stars 2.34k forks source link

Bug during display dynamic data with static slides #1160

Open m-wasilewski opened 4 years ago

m-wasilewski commented 4 years ago

Which OS ?

Both (Android & iOS)

Version

Which versions are you using:

Expected behaviour

All declared slides (static and dynamic) should display per one screen

Actual behaviour

If we declare slides and add dynamic data (with .map()) then all dynamic data are loaded on one slide :(

How to reproduce it>

      <Swiper showsButtons>
        <View style={styles.slide1}>
          <Text style={styles.text}>Look at next!!?!</Text>
        </View>
        {this.state.items.map((item, key) => {
          return (
            <View key={key} style={item.css}>
              <Text style={styles.text}>{item.title}</Text>
            </View>
          )
        })}
        <View style={styles.slide1}>
          <Text style={styles.text}>What happened there?</Text>
        </View>
      </Swiper>

image

Please look at that demo: https://snack.expo.io/@donwasyl/swipe---slide-bug

m-wasilewski commented 4 years ago

I fixed it and pushed pull request

m4manjesh commented 3 years ago

This fix works. Thanks

MaximeCrp commented 2 years ago

Confirming this issue and fix

hungdev commented 1 year ago

please merge it