You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用@hookform/resolvers 3.9.0时Yup Resolver出现类型不兼容错误

问题:@hookform/resolvers 3.9.0 类型转换错误

环境与代码

当前使用@hookform/resolvers 3.9.0版本,相关代码如下:

const form = useForm<FormType>({    
  defaultValues: { ...defaultFormFieldValues },    
  resolver: yupResolver(schema),    
  mode: 'onChange',  
});

错误信息

Resolver抛出以下类型不兼容错误:

Type 'Resolver<{val1: string}>' is not assignable to type Resolver<FormType,any>'
Types of parameters 'values' and 'values' are incompatible.
Type 'FormType' is not assignable with '{val1:string}'

补充情况

此前从未出现该问题,降级版本可解决,但未找到相关bug记录,请问有人遇到过这个问题吗?

内容的提问来源于stack exchange,提问作者Nemo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 01:39:54