leptos_form
leptos_form copied to clipboard
Vec of structs
As it currently stands, I'm having difficulty making a form involving a Vec of Structs, even if those structs derive Form themselves. ie:
#[form(...)]
pub struct MyData {
pub my_name: String,
pub sub_struct: Vec<SubData>
}
#[derive(..., Form)]
#[form(...)]
pub struct SubData {
pub my_number: i32
}
This fails with a type mismatch resolving the Signal type for SubData (FormField for Vec is only implemented where Signal is FormFieldSignal<T>
, but for SubData it's __SubDataSignal
).
- Am I missing any existing option that would help get around this
- If not, should Signal on SubData be changed to
FormFieldSignal<__SubDataSignal>
, or would a different approach be better?