How to reset the value of an object field in an array
hi everyone. is there a way to reset manually a value in an array field?
8 Replies
xenial-black•5mo ago
you may be looking for
listeners
it lets you have side effects for other fields if your field triggers the eventfascinating-indigoOP•5mo ago
ooouh nice, i wasnt aware of the existence of listeners, but it sounds like what i need !!
xenial-black•5mo ago
I'll fetch the docs link for you.
fascinating-indigoOP•5mo ago
hopefully it exists for solid form 😅
xenial-black•5mo ago
I don't think so, but it should be fairly easy to adapt. The fieldApi methods should be the same
https://tanstack.com/form/latest/docs/framework/react/guides/listeners here's the react version for comparison
Side effects for event triggers | TanStack Form React Docs
For situations where you want to "affect" or "react" to triggers, there's the listener API. For example, if you, as the developer, want to reset a form field as a result of another field changing, you...
fascinating-indigoOP•5mo ago
thank you!
xenial-black•5mo ago
I should clarify, you definitely 100% can do it in solid, but there's no docs explicitly for it
fascinating-indigoOP•5mo ago
yeah no doc is fine ;D
i can adapt it to solid