Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vec of structs #23

Open
0xADD1E opened this issue Mar 4, 2024 · 0 comments
Open

Vec of structs #23

0xADD1E opened this issue Mar 4, 2024 · 0 comments

Comments

@0xADD1E
Copy link

0xADD1E commented Mar 4, 2024

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).

  1. Am I missing any existing option that would help get around this
  2. If not, should Signal on SubData be changed to FormFieldSignal<__SubDataSignal>, or would a different approach be better?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant