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

how to disable swipe ? #53

Open
krunaldodiya opened this issue Nov 5, 2020 · 1 comment
Open

how to disable swipe ? #53

krunaldodiya opened this issue Nov 5, 2020 · 1 comment

Comments

@krunaldodiya
Copy link

Hi, this is a nice library, however it would be great if it includes swipeEnabled={false} so that, instead of manually swipe one can use programmatically swiping

@guytepper
Copy link

I've achieved this behavior with scrollEnabled prop (undocumented) set to false and the scrollToPage method:

function Onboarding() {
  const pages = useRef(null);

  useEffect(() => {
    pages.current.scrollToPage(2);
  }, []);

  return (
    <View>
      <Pages ref={pages} scrollEnabled={false}>
        <View />
        <View />
        <View />
      </Pages>
    </View>
  );
}

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

2 participants