Skip to content

Rule resolver: Expose value shorthand based on "valuePropName" instead of hard "value" #238

@kettanaito

Description

@kettanaito

Environment

  • react-advanaced-form: 1.1.0

What

I suggest to expose the prop based on valuePropName option, instead of hard value.

Why

For the fields where "value" is a not a value prop name (i.e. datepicker uses "selected" instead of "value"), it is confusing to receive a value parameter in the rule resolver function.

How

Provide { [valuePropName]: fieldProps.get(fieldProps.get('valuePropName')) } as a value prop shorthand in all validation rule resolvers.

Metadata

Metadata

Assignees

Labels

enhancementEnhances existing functionality.scope:validationChanges affect validation.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions