Reactjs Yup中的动态数值与react hook形式的比较
我有一个号码,我需要从我的组件发送到Yup模式。 此数字需要与YOU架构对象进行比较 正如您在下面的代码中所看到的: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
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 ** ))
});