Unmounting a field does not update the form
Christian24 opened this issue · comments
Christian24 commented
Describe the bug
Hi,
I just noticed a bug unmounting a field: the state and fieldInfo of the field is preserved in the form even after unmounting it.
To illustrate I added some expects to the unmount
test:
// Field should have been removed from the form as well
expect(form.state.values.name).toBeUndefined()
expect(form.state.fieldMeta.name).toBeUndefined()
These last assertions fail at the moment.
Your minimal, reproducible example
Steps to reproduce
- Run the tests
- they fail
Expected behavior
Tests pass
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- Jest
Tanstack Form adapter
None
TanStack Form version
latest
TypeScript version
No response
Additional context
No response
Christian24 commented
@crutchcorn can you please reopen this? seems it is not fully fixed.