diff --git a/components/doc/captcha/apidoc.js b/components/doc/captcha/apidoc.js
index d34482fc87..83e2af63ce 100644
--- a/components/doc/captcha/apidoc.js
+++ b/components/doc/captcha/apidoc.js
@@ -82,6 +82,12 @@ const showResponse = (response) => {
en |
Language of the widget. |
+
+ sourceUrl |
+ string |
+ https://www.google.com/recaptcha/api.js?render=explicit |
+ Source URL of the Captcha as some countries do not allow Google access. |
+
diff --git a/components/lib/captcha/Captcha.js b/components/lib/captcha/Captcha.js
index cd8d2ad4b7..43c7024018 100644
--- a/components/lib/captcha/Captcha.js
+++ b/components/lib/captcha/Captcha.js
@@ -45,7 +45,7 @@ export const Captcha = React.memo(
let head = document.head || document.getElementsByTagName('head')[0];
let script = document.createElement('script');
- script.src = 'https://www.google.com/recaptcha/api.js?render=explicit';
+ script.src = props.sourceUrl;
script.async = true;
script.defer = true;
@@ -103,12 +103,13 @@ Captcha.displayName = 'Captcha';
Captcha.defaultProps = {
__TYPE: 'Captcha',
id: null,
+ language: 'en',
+ onExpire: null,
+ onResponse: null,
siteKey: null,
- theme: 'light',
- type: 'image',
size: 'normal',
+ sourceUrl: 'https://www.google.com/recaptcha/api.js?render=explicit',
tabIndex: 0,
- language: 'en',
- onResponse: null,
- onExpire: null
+ theme: 'light',
+ type: 'image'
};
diff --git a/components/lib/captcha/captcha.d.ts b/components/lib/captcha/captcha.d.ts
index 991765ac43..47e89e5cf2 100644
--- a/components/lib/captcha/captcha.d.ts
+++ b/components/lib/captcha/captcha.d.ts
@@ -1,14 +1,15 @@
import * as React from 'react';
export interface CaptchaProps extends Omit, HTMLDivElement>, 'ref'> {
+ children?: React.ReactNode;
+ language?: string;
+ onExpire?(): void;
+ onResponse?(response: any): void;
siteKey?: string;
+ size?: string;
+ sourceUrl?: string;
theme?: string;
type?: string;
- size?: string;
- language?: string;
- onResponse?(response: any): void;
- onExpire?(): void;
- children?: React.ReactNode;
}
export declare class Captcha extends React.Component {