【发布时间】:2022-12-23 23:49:06
【问题描述】:
是的,因为没有键入上下文值而导致 Typescript 错误:
Property 'originalValue' does not exist on type 'TestContext<AnyObject>'.
使用 yup 函数测试时,我收到 originalValue 的打字稿错误。我应该输入什么上下文来消除这个错误?
.test('00s', 'not a valid number', (value, context) => {
return context.originalValue.match(ssnRegex)
}),
【问题讨论】:
标签: react-hook-form yup