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

add check to isReady for necessary DOM element, for issue 181 #259

Open JZebra opened 5 years ago

JZebra commented 5 years ago

I was still having this issue: https://github.com/appleboy/react-recaptcha/issues/181 despite using this solution: https://github.com/appleboy/react-recaptcha/issues/181#issuecomment-280800414

Unfortunately, I can't share the source code where I experienced this bug. It's a private repo. I can show before/after videos though if needed.

The root cause is that the component calls this._renderGrecaptcha() in componentDidMount, before render can run. This change was sufficient to resolve the issue for me

EDIT: I forgot about specs. I'll try to fix them tomorrow