Default value on field is overwriting default value on useAppForm
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
Describe the bug
As mentioned in the title if you have a default value on a form.AppField this overwites the value coming from useAppForm for async loading. Hierarchically these should be overwritten from parent.
Prio
useAppFormdefaultValueformOptionsdefaultValueform.AppFielddefaultValue
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/frosty-james-mwktlf
Steps to reproduce
- Create a
useAppFormwithdefaultValue - Declare an empty string or
countryCodefor a field as default value if no value exists - Have
defaultValuefrom base - Expect
defaultValuechange on root to overwrite fieldDefaultValue
Expected behavior
Expect defaultValue change on root to overwrite fieldDefaultValue
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
Windows
Chrome 136.0.7103.114
TanStack Form adapter
None
TanStack Form version
^1.11.1
TypeScript version
^5.8.3
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproduction and trace how default values from useAppForm, formOptions, and form.AppField are combined during async loading. Verify the precedence described in the issue, with a root useAppForm defaultValue overriding the field-level defaultValue when it changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100