我为表单创建了一个模型,该模型通过它进行映射以使用react-hook-form创建表单
当我第一次提交表格时,一切都很好。但在其他时候,当我将值粘贴到输入中时,验证无法正常工作(它显示所需的错误,但输入不为空)
这是模型:
export const formData = [
{
id: 1,
type: "text",
labelRequired: true,
label: "name",
shape: "inline",
placeholder: "name",
name: "nameOne",
validation: {
required: true,
minLength: 8,
},
size: 6,
},
{
id: 2,
type: "text",
labelRequired: true,
label: "family",
shape: "inline",
placeholder: "family",
name: "nameTwo",
validation: {
required: true,
minLength: 8,
},
size: 6,
},
{
id: 7,
type: "checkbox",
label: "Sample",
shape: "checkbox",
placeholder: "placeholder",
name: "checkbox_btn",
data: [
{
id: 41,
inputId: "inline-form-1",
label: "1", …Run Code Online (Sandbox Code Playgroud)