Reset form does not work as expected in combination with `useStore`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从链接的 StackBlitz 复现开始,比较启用第 12 行与启用第 13 行时的行为。跟踪重置为新值时如何与 useStore 订阅交互,然后验证重置后输入仍保留 x === 5 和 date === new Date(2025, 0, 1)。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I realize there are some related issues (https://github.com/TanStack/form/issues/1490) but I think there are still some bugs somewhere.
It seems like after resetting to new values, subscribing to the state of those new values reverts them to the default values.
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-x8aebugd?file=src%2FApp.tsx
Steps to reproduce
- go to sandbox
- observe
x === 1anddate === new Date()in the input fields. this is incorrect. - comment out line 12 and comment in line 13
- observe
x === 5anddate === new Date(2025, 0, 1)in the input fields. this is correct.
Expected behavior
x === 5 and date === new Date(2025, 0, 1)
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- macOS
- brave
- 1.82
TanStack Form adapter
react-form
TanStack Form version
v1.19.5
TypeScript version
No response
Additional context
No response
- 主要语言
- TypeScript
- 星标
- 6.8k
- 派生
- 705
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/form 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
`isDefaultValue` is wrong when a field-level `defaultValue` is `null`可能已有人在做 @fenet-as 于 23 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Async validator doesn't re-trigger `isValidating` after first failed validation可能已有人在做 @drewsephski 于 28 天前认领。 未关闭
难度 2/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
[v2 alpha] devtools are always light mode可能已有人在做 @dikshit-n 于 62 天前认领。 未关闭area: runtime scope: devtools type: bug v2
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
FormGroupApi.getRelatedFields and FieldApi.validate() use unguarded startsWith for group membership, matching unrelated fields with a shared name prefix可能已有人在做 @HDPark95 于 80 天前认领。 未关闭area: runtime scope: core type: bug v1
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
相似的 Issue
-
area: infrastructure bug priority: low
难度 2/5 1-3 小时 新手友好度 88/100
snapotter-hq/SnapOtter#4575 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
documentation server-memory v2
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/servers#5457 ·
维护者通常 1 天内回复
-
comp: ssr comp: zones type: feature version: current (v17+)
难度 2/5 1-3 小时 新手友好度 84/100
angular/angularfire#3836 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复