reactjsreact-reduxredux-form

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


I have a cancel button in my form page and I added

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

to it to clear the form, but I get TypeError: resetForm is not a function


Solution

  • While the documentation does say that in order to reset the form you should use the resetForm prop, as can be seen here, the prop you actually want to use is simply reset.

    Apparently the docs are actually out of date based on this issue here.