MrBr/antd-zod

use in array formItem name

Closed this issue · 3 comments

hi,
In my form, it is called array

<Form.Item
name={ [ 'config', 'type' ] }
label={ 'Authentication type' }
rules={ [ createSchemaFieldRule(ProviderAuthZod) ] }
>
<Select
options={ [
{
label: 'Custom',
value: 'Custom'
},
{
label: 'OAuth',
value: 'OAuth'
}
] }
/>
</Form.Item>

in this case dont work

MrBr commented

Hey, sorry for a late reply. It should be working, I've added an example https://github.com/MrBr/antd-zod/blob/main/stories/basic.stories.tsx#L29

Hey, sorry for a late reply. It should be working, I've added an example https://github.com/MrBr/antd-zod/blob/main/stories/basic.stories.tsx#L29

I mean this when the name of the form item is like this: name={ [ 'config', 'type' ] }

MrBr commented

Added a story for nested property. It should be working. Please double check you're Zod schema.

https://github.com/MrBr/antd-zod/blob/main/stories/basic.stories.tsx#L42