resetForm 不是函数,为什么会出现此错误?

resetForm is not a function, why do i get this error?

我的表单页面中有一个取消按钮,我添加了

onClick={() => this.props.resetForm()}

用它来清除表格,但我得到 TypeError: resetForm is not a function

虽然文档确实说为了重置表单,您应该使用 resetForm 道具,正如可以看到的 here,您实际想要使用的道具只是 reset.

显然,根据这里的 issue,文档实际上已经过时了。