callstack / callstack/react-native-pager-view

setPage(index) not working — no effect

Open
#1,021 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.4k
Forks
476
Avg merge
10d 21h
Merged PRs (30d)
2

Description

## Environment

| Key | Value |
|----------------------|---------------------------|
| Library | `react-native-pager-view` |
| Tested versions | `6.5.1`, `6.9.1`, `7.x` (latest) |
| Platform | Android only |
| Android API tested | API 29 |
| Error logs | None |
| Expected behavior | Pager view should switch to the requested index |

## Description

Calling `setPage(index)` on `react-native-pager-view` has no visible effect. The page does **not** change, and no error or warning is thrown.

This issue persists across multiple versions of the library and on Android.

## Reproducible Demo

Using hook (`usePagerView`) to wrap the pager logic and calling setPage should update the pager to show the corresponding page.
• Is there an internal condition that could silently block setPage()?
• Is the method fully supported on Android 29?

```tsx
const { AnimatedPagerView, ...rest } = usePagerView({ pagesAmount: 3 })

Tabs

rest.setPage(0)}>
Tab 1

rest.setPage(1)}>
Tab 2

rest.setPage(2)}>
Tab 3

PagerView

{/* 3 View */}

Thanks in advance for any help or guidance on this issue!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.