callstack / callstack/react-native-pager-view
persist current page if we add item at the start of array
- Lingua principale
- TypeScript
- Stelle
- 3.4k
- Fork
- 476
- Merge medio
- 10g 21h
- PR unite (30g)
- 2
Descrizione
## Describe the feature
```
{posts.items.map(renderItem)}
```
for example, I have an array like this `posts=[4,5,6,7]` which I render in `PagerView` and go to the index 2 means `6`
then I add some items at the start of the array
```
[1,2,3].concat(posts)
```
when I set state I lost my current page which is logical `6`. I think there should be a prop for persisting current page if I add items at the start of an array
## Motivation
like TIKTOK app, when we swipe up and up then pagination api call and TikTok add more video at the start of an array
## Related Issues
N/A
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal componente PagerView e traccia come initialPage, onPageSelected e le modifiche agli elementi figli renderizzati influenzano la pagina selezionata. Riproduci l'esempio anteponendo elementi all'array, quindi definisci il completamento come il mantenimento dello stesso elemento logico selezionato dopo la modifica dell'array; l'issue non indica alcun file o test specifico.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react-native, typescript
- Ambito
- mobile
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 28/100