Skip to content

Setting "debounceValidate" on field record within "Form.registerField" diverges the field record #221

@kettanaito

Description

@kettanaito

Environment

  • react-advanaced-form: 1.0.0

What

There is an issue that debounceValidate is set on the field record within Form.registerField method. Because of that, the internal Field's this.contextProps reference contains no such property on the field record at all. Apparently, relying on componentWillUpdate is not safe, since right now I am able to reproduce the situation when onChange validation throws due to missing fieldRecord.debounceValidate function.

How

I see two solutions to this:

  1. Set debounceValidate on Field.register and just read it in Form.registerField
  2. Or, have a fallback validator function in case fieldRecord.debounceValidate is undefined.

Perhaps, combining the two is also quite possible.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions