I am not able to figure out how to add custom validation in antd form in react. Validator function will work or not. Please suggest a suitable approach.
<Form.Item
label="Name"
name="name"
rules={[
{
required: true,
message: 'The name is required.',
},
{
pattern: /^[a-zA-Z0-9]+$/,
message: 'Name can only include letters and numbers.',
},
]}
>
<Input />
</Form.Item>
validator
property from the Rule API. – Derbent