rule

Specification

A synchronous rule applied to the field as the top priority validation. When the rule rejects, all the remaining validation chain is ignored.

Definition

type Rule = RegExp | (params) => boolean

Parameters

The following parameters are exposed to the rule when it is a function:

Parameter name

Type

Description

get

Function

Reactive props getter function.

value

any

The current value of the field.

fieldProps

Object

Props of the current field.

fields

Object

Map of all fields.

form

Object

A reference to the current Form

Example

Regular expression

Resolver function

Reactive rule

Read more about Reactive props feature, it is a game-changer.

Last updated