【发布时间】:2019-02-01 07:31:06
【问题描述】:
我有redux-form 我有输入字段,当它被触摸时它会显示错误,如果有的话。现在我想在重新加载页面时将输入字段的 touched 属性重置为false。我该怎么做?
我使用redux-persist 来保持状态,所以我必须明确地这样做,所以我需要在componentDidMount 中将touched 属性设置为false。
【问题讨论】:
-
不,我如何使用它,我是 redux-form 的新手
-
我想我想在componentDidMount中使用untouch
-
要不要这样用 this.props.untouch('formName', 'fieldName')
-
是的,我知道了,我必须按照上面的方式使用它
标签: reactjs redux redux-form