diff --git a/packages/webapp/src/pages/form/Render/CustomCode.tsx b/packages/webapp/src/pages/form/Render/CustomCode.tsx index b816f6cf..7c8815cc 100644 --- a/packages/webapp/src/pages/form/Render/CustomCode.tsx +++ b/packages/webapp/src/pages/form/Render/CustomCode.tsx @@ -80,6 +80,15 @@ export const CustomCode = ({ form, query }: { form: FormModel; query: Record { + if (form.settings!.captchaKind === CaptchaKindEnum.GOOGLE_RECAPTCHA) { + const script = document.createElement('script'); + script.src = `https://www.google.com/recaptcha/api.js?render=${GOOGLE_RECAPTCHA_KEY}`; + script.async = true; + document.body.appendChild(script); + } + }, [form.settings!.captchaKind]); + return ( <> @@ -88,13 +97,6 @@ export const CustomCode = ({ form, query }: { form: FormModel; query: Record )} - {form.settings!.captchaKind === CaptchaKindEnum.GOOGLE_RECAPTCHA && ( -