-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
type: Allow insert null value to FieldArray #246
Comments
Can't you add an empty value (e.g. empty string)? Feel free to share your use case and code with me. |
No, the schema is an object, and a key of object is string literal union types. This is my schema:
|
I understand and will check if we can allow import * as v from 'valibot';
const LanguageSchema = v.picklist(['DE', 'FR', 'US']);
const LanguageArraySchema = v.array(
v.object({
language: v.pipe(v.optional(LanguageSchema), LanguageSchema),
localized_name: v.string(),
})
); |
Unfortunately, I couldn't find a quick fix as I encountered some more complex TypeScript errors. I may try again when I have more time or consider it when rewriting the library at some point. |
Thanks for your work. For now, changing the schema is a good workaround. |
In my case, I need to insert a new entry without value into
FieldArray
, but the current type definition does not support this.The text was updated successfully, but these errors were encountered: