callstack / callstack/react-native-pager-view

Page cannot be navigated to after being dynamically added

Aperta
#949 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
3.4k
Fork
476
Merge medio
10g 21h
PR unite (30g)
2

Descrizione

## 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).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal repository di riproduzione collegato e dal relativo README, usando la configurazione indicata e l’azione “Add new page and navigate to it”. Confronta il comportamento normale con il branch working-example e l’impostazione new-architecture; il lavoro è completato quando, con le versioni indicate, è possibile navigare a una pagina aggiunta dinamicamente senza nessuno dei due workaround.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react-native, typescript
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.