kkemple/react-native-sideswipe

SideSwipe not working inside ScrollView

AlexisLeon opened this issue · 4 comments

Following your example:

import { View, Dimensions, ScrollView } from 'react-native';

export default class SweetCarousel extends Component {
  state = {
    currentIndex: 0,
  };

  render = () => {
    // center items on screen
    const { width } = Dimensions.get('window');
    const contentOffset = (width - Card.WIDTH) / 2;

    return (
      <ScrollView>
        <SideSwipe
          index={this.state.currentIndex}
          itemWidth={Card.WIDTH}
          style={{ width }}
          data={data}
          contentOffset={contentOffset}
          onIndexChange={index =>
            this.setState(() => ({ currentIndex: index }))
          }
          renderItem={({ itemIndex, currentIndex, item, animatedValue }) => (...)}
        />

        ...
      </ScrollView>
    );
  };
}

hey! thanks for reporting this! looking into it now

this should be fixed in 1.2.1, please let me know if you still have issues!

here is it working in a snack
feb-07-2018 16-02-19

going to close this since no response

Fixed in 1.2.1. Thanks @kkemple