获取字段的错误值
Get error values of fields
我想获取表单中所有字段的 name
的错误值。我想显示一个 "form-level" 错误,说 "you need to go look at this field" 并且单击各个消息会将它们滚动到该字段。
除了来自 this.props.error
的 "form-level" 错误之外,我一直无法弄清楚如何得到任何东西。
我有类似的要求,我使用了 getFormSyncErrors
选择器,其中 returns 一个对象,其键是无效字段的名称,其值是相应的错误:
{
recipientAddress: "Required",
recipientCity: "Required",
recipientZip: "Required"
}
我想获取表单中所有字段的 name
的错误值。我想显示一个 "form-level" 错误,说 "you need to go look at this field" 并且单击各个消息会将它们滚动到该字段。
除了来自 this.props.error
的 "form-level" 错误之外,我一直无法弄清楚如何得到任何东西。
我有类似的要求,我使用了 getFormSyncErrors
选择器,其中 returns 一个对象,其键是无效字段的名称,其值是相应的错误:
{
recipientAddress: "Required",
recipientCity: "Required",
recipientZip: "Required"
}