modular-forms icon indicating copy to clipboard operation
modular-forms copied to clipboard

[Question] Initial value as array generates unnecessary new field

Open DedeKurnn opened this issue 1 year ago • 1 comments

I'm using Qwik and I'm trying to get initial value of type array using route loader, but it generate these unnecessary additional fields with dot notation which mess up the validation.

      const response = await fetchData({
        requestEvent,
        endpoint,
      });

      return {
        dialect_id: response.data.dialect_id // this is array of string,
        bahasa_indonesia: response.data.bahasa_indonesia,
        bahasa_lampung: response.data.bahasa_lampung,
        sentence_lpg: response.data.sentence_lpg,
        sentence_id: response.data.sentence_id,
        region_id: response.data.region_id // this is array of number,
        status: "pending",
      };

image

I do not want this behavior. How do I solve this?

DedeKurnn avatar Nov 16 '24 08:11 DedeKurnn

Can you share your schema or TypeScript type with me and also the useForm code?

fabian-hiller avatar Nov 20 '24 22:11 fabian-hiller