Skip to content

Typescript errors for optional nested fields #267

Open
@ngryman

Description

Hey,

First of all, thank you for your amazing work. This library and valibot are very well designed libraries that I really enjoy using. Thanks!

Probably related to #144 and #173, I have Typescript errors when using optional nested fields.

You can find a reproduction here.

You should be able to see the errors I'm talking about in automation.tsx:

  1. The Field type is inferred to undefined for a nested field.
  2. The setValue value argument is never.

If you remove the optional suffix for schedule, everything works as expected.

This is not a blocking issue obviously but it messes up with the great DX of this library.

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions