我正在尝试在类型脚本项目中reCaptcha
从react-google-recaptcha实现不可见
我添加了包的类型
yarn add @types/react-google-recaptcha
但是当我想实现组件时,我在这里得到一个类型脚本错误
<ReCAPTCHA
ref={recaptchaRef} // IN HERE
size="invisible"
sitekey="Your client site key"
/>
这是错误的内容
Type 'MutableRefObject<undefined>' is not assignable to type 'LegacyRef<ReCAPTCHA> | undefined'.'' Type 'MutableRefObject<undefined>' is not assignable to type 'RefObject<ReCAPTCHA>'. Types of property 'current' are incompatible.