react-recaptcha icon indicating copy to clipboard operation
react-recaptcha copied to clipboard

Recaptcha doesn't fully render to DOM

Open hantc opened this issue 8 years ago • 8 comments

When using recaptcha inside JSX, Recaptcha is not fully rendered. Div is blank.

<div class="g-recaptcha" data-sitekey="my-own-tested-and-valid-key" data-theme="light" data-type="image" data-size="normal" data-tabindex="0" data-reactid=".1.0.1.3"></div>

react-recaptcha is imported and rendered as <Recaptcha sitekey="my-own-tested-and-valid-key" />

hantc avatar Aug 22 '16 16:08 hantc

Are you using the recaptcha script on your index-page?

filip-ph-johansson avatar Oct 31 '16 14:10 filip-ph-johansson

Possibly same problem as #181

MrHash avatar Dec 15 '16 17:12 MrHash

I am seeing this problem using React 15.4.1 on mac os in Chrome. Trying to solve for #181 does not work in my case

cindyloo avatar Mar 13 '17 20:03 cindyloo

@hantc You can't embed script tag inside JSX. This just won't work. You should dynamically add the script tag to the HTML using Javascript. I've already opened an issue regarding this to be supported in the library out of the box! Please refer to https://github.com/appleboy/react-recaptcha/issues/212 for the workaround.

farskid avatar Nov 06 '17 21:11 farskid

I ran into the empty div issue as well. I used scriptjs in componentDidMount and the script was added to the head and the reCAPTCHA rendered as expected.

$script('https://www.google.com/recaptcha/api.js', 'recaptcha');

corydeppen avatar Jan 09 '18 04:01 corydeppen

I ran into the empty div issue as well. I used scriptjs in componentDidMount and the script was added to the head and the reCAPTCHA rendered as expected.

$script('https://www.google.com/recaptcha/api.js', 'recaptcha');

any example how to do so?

Hiti3 avatar Jun 11 '21 10:06 Hiti3

Any updates on this issue?

altyntsevlexus avatar Sep 09 '22 07:09 altyntsevlexus

Any updates on this issue?

there is a nope from the community..

Hiti3 avatar Sep 09 '22 07:09 Hiti3