grecaptcha未使用react定义

grecaptcha未使用react定义

本文介绍了Firebase grecaptcha未使用react定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我从此文件的此处复制了代码:

I copied the code from this bit here in the documentation:

window.recaptchaVerifier.render().then(function(widgetId) {
  grecaptcha.reset(widgetId);
}

但是在我的反应项目grecaptcha中是未定义的.我看不到他们在哪里将其声明为变量或在Firebase中从哪里获取它.

However in my react project grecaptcha is undefined. I don't see where they declare it as a variable or where to get it from in firebase.

推荐答案

不知道为什么,但是对我来说很好:

Not sure why but this worked for me just fine:

window.recaptchaVerifier.render().then(widgetId => {
  window.recaptchaVerifier.reset(widgetId);
});

我没有做grecaptcha,而是做了window.recaptchaVerifier,它像一种魅力.

Instead of doing grecaptcha, I just did the window.recaptchaVerifier and it worked like a charm.

这篇关于Firebase grecaptcha未使用react定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 13:18