Form composition with async values
I’ve read that the optionsForm need to be the same between composants.
I create my default value inside a composant that receive data from props.
How can i handle async default values?
4 Replies
afraid-scarletOP•7mo ago
I want to declare a form in my MainForm components (with async default values), that have 4 sub forms (with a read mode and edit mode per sub form)
I can’t find a way to declare a main form and re-use this form object into my subforms.
Ideally, i dont want to use 4 useForm in each of my subform.
I dont know if it’s clear
xenial-black•7mo ago
type them
the defaultValues will come from your original
useAppForm, but you can inform withForm about the structure of the default values using the formOptions function
So you'll want
afraid-scarletOP•7mo ago
Thanks for your help, can i pass props to my subForm ?
xenial-black•7mo ago
yes,
withForm has a props property that allows you to define extra parameters
from the Form Composition docs: