google recaptcha

withGoogleReCaptcha

Higher-order component for accessing reCAPTCHA functionality in class components

const WithGoogleReCaptchaComponent = withGoogleReCaptcha(Component);

Injected props

PropertyTypeDescription
instanceReCaptchaInstance | nullThe reCAPTCHA instance.
isLoadingbooleanWhether the reCAPTCHA script is still loading.
languagestringThe language code used for reCAPTCHA.
siteKeystringThe site key used for reCAPTCHA.
executeV3(action?: string) => Promise<string>Executes reCAPTCHA v3 verification. Returns a promise that resolves to the verification token.
executeV2Invisible() => Promise<string>Executes reCAPTCHA v2 invisible verification. Returns a promise that resolves to the verification token.
reset() => voidResets the reCAPTCHA widget.
getResponse() => stringGets the current reCAPTCHA response token.
render() => voidRenders the reCAPTCHA widget.

On this page