react-google-recaptcha :在 React-Redux 中设置 window 属性

react-google-recaptcha : Setting window attributes in React-Redux

我正在尝试在我的应用程序中动态设置 recaptcha 语言。在此处查看文档 https://github.com/dozoisch/react-google-recaptcha

In order to translate the reCaptcha widget, you should create a global variable configuring the desired language. If you don't provide it, reCaptcha will pick up the user's interface language.

  window.recaptchaOptions = {
   lang: 'fr'
  }

如果我在根 app.js 文件

中设置全局 window.recaptchaOptions 对象,这将起作用

我要解决的问题是在创建商店后在 index.js 中设置 window.recaptchaOptions。

调查请求,看起来 google recaptcha__fr 脚本只有在我在根应用程序中设置全局 window.recaptchaOptions 时才会被拉入。这不允许我访问商店。

关于如何解决这个问题以便我可以在创建商店后在 index.js 中设置 window.recaptchaOptions 有什么想法吗?

谢谢

我在这里提出了一个问题https://github.com/dozoisch/react-google-recaptcha/issues/67

PR即将合并