react-native-pager-view
react-native-pager-view copied to clipboard
Page cannot be navigated to after being dynamically added
Environment
- react-native-pager-view: 6.5.1
- react: 18.3.1
- react-native: 0.76.5
- expo: 52.0.18
Description
A page cannot be navigated to after being dynamically added. See also the reproduction repository's README.
Reproducible Demo
Setup
- Clone repository: https://github.com/winghouchan/react-native-pager-view-dynamic-page-mcve.
- Install dependencies (
yarn). - Build the app (
npx expo prebuild&&yarn ios).
Reproduction
- After opening the app, press "Add new page and navigate to it".
A new page should be added and navigated to. Instead, the new page is added (seen in the component tree in dev tools) but not navigated to.
Additional notes
Doing either of the following seems to work around the issue:
- Wrapping
setPageinsetTimeout(..., 0) - Disabling React Native's new architecture (see
working-examplebranch, a rebuild is required before running).