callstack / callstack/react-native-pager-view

persist current page if we add item at the start of array

Abierto
#427 1 comentario 2 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
TypeScript
Estrellas
3.4k
Forks
476
Merge medio
10 d 21 h
PR fusionados (30 d)
2

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en el componente PagerView y sigue cómo initialPage, onPageSelected y los cambios en los hijos renderizados afectan a la página seleccionada. Reproduce el ejemplo anteponiendo elementos al array y define la finalización como mantener seleccionado el mismo elemento lógico después de que cambie el array; el issue no nombra ningún archivo ni test específicos.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react-native, typescript
Área
mobile
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
28/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.