appleboy / react-recaptcha

A react.js reCAPTCHA for Google
https://www.google.com/recaptcha/intro/index.html
BSD 3-Clause "New" or "Revised" License
635 stars 97 forks source link

Error on multiple recaptchas per page #193

Closed palafoxernesto closed 7 years ago

palafoxernesto commented 7 years ago

Thank you for creating this component, I want to use more than one recaptcha on the same page, but i am getting an error:

screenshot from 2017-05-26 14 31 34

the code that i am using is:

<Recaptcha sitekey='XXXX' render='explicit' verifyCallback={this.captchaVerify} onloadCallback={this.captchaOnload} />

What am i doing wrong?

waseemshahwan commented 7 years ago

+1

Badestrand commented 7 years ago

For everyone having that problem: Simply define elementID on the element, e.g.

<Recaptcha elementID="a1" sitekey="..."/>
<Recaptcha elementID="a2" sitekey="..."/>
appleboy commented 7 years ago

set element id? see https://github.com/appleboy/react-recaptcha/blob/master/src/index.js#L7

Badestrand commented 7 years ago

Yes, issue can be closed I think