callstack / callstack/react-native-pager-view
persist current page if we add item at the start of array
- Langage dominant
- TypeScript
- Étoiles
- 3.4k
- Forks
- 476
- Merge moyen
- 10 j 21 h
- PR mergées (30 j)
- 2
Description
## 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par le composant PagerView et suivez comment initialPage, onPageSelected et les modifications des enfants rendus affectent la page sélectionnée. Reproduisez l’exemple en ajoutant des éléments au début du tableau, puis définissez l’achèvement comme le fait de conserver le même élément logique sélectionné après la modification du tableau ; l’issue ne nomme aucun fichier ni test spécifique.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- react-native, typescript
- Domaine
- mobile
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 28/100