Question: How is the stack lifecycle (`activities` array) intended to be managed?
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend, mobile-dev
调研方向
从 useStack() 的官方文档以及围绕 push、replace 和 pop 的 activities 生命周期开始。确定该 array 是否有意设计为只追加,以及返回 root 时是否应截短它,还是应通过 transitionState、isTop 和 isActive 保持可观察。完成的标准是记录预期行为,或定义明确的重置/截短要求。
由索引模型根据 Issue 内容生成。
描述
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?
- 主要语言
- TypeScript
- 星标
- 1k
- 派生
- 114
- 平均合并
- 59 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
daangn/stackflow 的其他 Issue
-
스와이프 백 애니메이션 덜컥임 이슈可能重新可做 @Shennng 于 222 天前认领,目前没有进行中的 PR。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
-
Vue3 지원 계획未关闭
难度 5/5 一周以上 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 18/100
-
难度 5/5 一周以上 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
agilepathway/label-checker#739 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
CopilotKit/OpenBot#800 ·
维护者通常 1 天内回复
-
Endpoint links in the tag operations list are below the 24px target size可能已有人在做 @AdzerKI 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复