Open mmckinley8 opened 2 years ago
Yes! You can add onPress event and use the this.cube.scrollTo(index)
function to go to next and prev views.
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;
}}>
.
.
.
.
.
);
}
Is there a way to trigger the transition when the screen is press, similar to Instagram stories