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

Trigger transition onPress? #47

Open
mmckinley8 opened this issue May 5, 2022 · 2 comments
Open

Trigger transition onPress? #47

mmckinley8 opened this issue May 5, 2022 · 2 comments

Comments

@mmckinley8
Copy link

Is there a way to trigger the transition when the screen is press, similar to Instagram stories

@zehfernandes
Copy link
Owner

Yes! You can add onPress event and use the this.cube.scrollTo(index) function to go to next and prev views.

@rahillakhani
Copy link

If its a functional component

function xyz () {
const pageNum =2, shouldAnimate = true;
let cube = useRef();
.
.
.
.
function somFunction = () {
.
.
.
cube.current.scrollTo(pageNum, shouldAnimate);
.
.
.
}

return (
<CubeNavigationHorizontal key={0} ref={(view) => {
cube.current = 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

3 participants