react / react/react-native-website

Ambiguity on why the index property in ViewToken is marked optional

Abierto
#3,637 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Never gets stale
Lenguaje dominante
MDX
Estrellas
2.2k
Forks
6.3k
Merge medio
11 h 37 min
PR fusionados (30 d)
19

Descripción

Description

On the ViewToken page in the docs it shows that the index property is optional. This is not explained in any further detail by the docs.

What is the problem?

It is unclear to me in what situation this property would be null. This object is used as a parameter for the onViewableItemsChanged callback in VirtualizedList so it is in turn also used in both FlatList and SectionList. This makes me think there wouldn't be a situation where index would be null.

How can we address it?

Update the description of the index property on ViewToken to clarify in what situation it could be null.

If anyone knows a resource like an issue in the react-native repo or a from post that discusses this or can explain it to me I can also make a PR to clarify the description on the property.

Why is it important?

It is currently ambiguous why the index property on ViewToken is marked as optional.

Who needs this?

Anyone using the onViewableItemsChanged prop and relies on the indexes of the callback.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la página de ViewToken en la documentación de React Native e inspecciona la descripción de su propiedad opcional index. Revisa cómo se usa ViewToken mediante el callback onViewableItemsChanged en VirtualizedList, FlatList y SectionList, y confirma después la situación que permite un índice null. Actualiza la descripción de la propiedad para explicar esa situación y verifica la documentación renderizada.

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

Evaluación

Stack tecnológico
react-native
Área
documentation
Tipo de issue
Documentación
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.