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

Page cannot be navigated to after being dynamically added #949

Open
winghouchan opened this issue Dec 16, 2024 · 0 comments
Open

Page cannot be navigated to after being dynamically added #949

winghouchan opened this issue Dec 16, 2024 · 0 comments

Comments

@winghouchan
Copy link

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

  1. Clone repository: https://github.com/winghouchan/react-native-pager-view-dynamic-page-mcve.
  2. Install dependencies (yarn).
  3. Build the app (npx expo prebuild && yarn ios).

Reproduction

  1. 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 setPage in setTimeout(..., 0)
  • Disabling React Native's new architecture (see working-example branch, a rebuild is required before running).
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

1 participant