-
Notifications
You must be signed in to change notification settings - Fork 455
Open
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?
const { AnimatedPagerView, ...rest } = usePagerView({ pagesAmount: 3 })
Tabs
<TouchableOpacity onPress={() => rest.setPage(0)}>
<Text>Tab 1</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => rest.setPage(1)}>
<Text>Tab 2</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => rest.setPage(2)}>
<Text>Tab 3</Text>
</TouchableOpacity>
PagerView
<AnimatedPagerView
initialPage={0}
orientation="horizontal"
style={styles.pager}
>
{/* 3 View */}
</AnimatedPagerView>
Thanks in advance for any help or guidance on this issue!Metadata
Metadata
Assignees
Labels
No labels