Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Question: How is the stack lifecycle (`activities` array) intended to be managed?

Abierto
#631 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Documentación
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
react, typescript

Línea de trabajo

Comienza con la documentación oficial de useStack() y del ciclo de vida de las actividades en torno a push, replace y pop. Determina si el array está diseñado intencionadamente para ser solo de adición y si volver al root debería recortarlo o seguir siendo observable mediante transitionState, isTop e isActive. Se considera completado cuando se documenta el comportamiento previsto o se define un requisito claro de restablecimiento/recorte.

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

Descripción

According to the official documentation, the useStack() hook can be used to access the stack state within UI components. However, when examining the activities array returned from useStack(), I noticed that its length increases by one each time the push or replace functions are called, and does not decrease when the pop function is invoked.

It is true that by checking properties such as transitionState, isTop, or isActive, one can determine which screen the user is currently viewing. Still, if the user repeatedly performs push or replace operations, the array continues to grow regardless of what the user actually sees. Intuitively, in scenarios such as when the user has finished navigating and returned to the root activity, one would expect the array to reset. Without some form of cleanup, the length of the array could, at least in theory, grow without bound.

As far as I know, Stackflow does not currently provide an API to reset or trim the stack state array in this manner. Of course, since Stackflow is obviously well-designed to be easily extended and customized through plugins, I imagine it would not be very difficult for me to implement additional functionality by myself if needed. That said, before proceeding, I would like to confirm whether my understanding aligns with the framework’s intended design. Or am I perhaps misunderstanding how the lifecycle of the stack is meant to be managed?

Lenguaje dominante
TypeScript
Estrellas
1k
Forks
114
Merge medio
59 min
PR fusionados (30 d)
4

Preparar el entorno

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.

Más de daangn/stackflow

Todos los issues de daangn/stackflow

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.