Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs Yup中的动态数值与react hook形式的比较_Reactjs_Yup - Fatal编程技术网

Reactjs Yup中的动态数值与react hook形式的比较

Reactjs Yup中的动态数值与react hook形式的比较,reactjs,yup,Reactjs,Yup,我有一个号码,我需要从我的组件发送到Yup模式。 此数字需要与YOU架构对象进行比较 正如您在下面的代码中所看到的:childrenParticipants应始终小于任何动态值 export const bookingsSchema = yup.object().shape({ childrenParticipants: yup .number() .required('This Field is blank') .integer('This Field must b

我有一个号码,我需要从我的组件发送到Yup模式。 此数字需要与YOU架构对象进行比较

正如您在下面的代码中所看到的:
childrenParticipants
应始终小于任何动态值

export const bookingsSchema = yup.object().shape({
  childrenParticipants: yup
    .number()
    .required('This Field is blank')
    .integer('This Field must be an integer')
    .min(
      0,
      'This Field must be greater than or equal to 0'
    )

    .lessThan(yup.ref( ** ANY DYNAMIC VALUE ** ))
});