T
TanStack•2y ago
optimistic-gold

setValue onChange in TanStack Form (third party date time library (Dayjs) with Zod validation)

How do I set values in a TanStack form? I can't figure this out, and I've reached the limit of my ability to understand the documentation. This is a question that follows up the thread I have in<#1212550427372036116>
6 Replies
optimistic-gold
optimistic-goldOP•2y ago
For context, I made a code standbox that anyone can use to see a mockup of my codebase. This is the first time our team is using TanStack Form, so any development advice on the structure is appreciated as well I've repaired the codebase on codesandbox so that it renders right now. I intend to use this codebase to better illustrate the issues i have, and ask for help in implementing specific TanStack features like: "how do i trigger an update on a different field, B, while inside the onChange function definition of Field B" or "how do I change value of some field B to incorperate the change in field A?" Imagine two fields, a LastName and a FirstName , and a third field FullName that is supposed to automatically update when information is changed. I'll return here in an hour or two to see if someone has ideas. the codesandbox codebase can be accessed by anyone with the link here
optimistic-gold
optimistic-goldOP•2y ago
optimistic-gold
optimistic-goldOP•2y ago
@crutchcorn Do you have any time this weekend to assist?
noble-gold
noble-gold•2y ago
I don't 😅 I have a family funeral and some other stuff to tackle
optimistic-gold
optimistic-goldOP•2y ago
oh gosh, very sorry for your loss! some other time then Is there any chance this can be solved using the TanStack API ? between Subscribe useForm and it's methods useField and its methods, I think this should be possible.
noble-gold
noble-gold•2y ago
I wouldn't try to solve this yourself ATM There's going to be a onChangeListenTo: ['other_field'] API coming out in a month or so So anything you do today will inevitably be replaced

Did you find this page helpful?