New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reCAPTCHA has already been rendered in this element #262
Comments
@philonor as I found here #229 the issue is really easy to fix. Use isBrowser of useSSR Hook https://github.com/alex-cory/use-ssr
|
@fernandopulsa Saved my ass!, But is there a reason we don't just do |
Gatsby JS is not a SSR tool. If you try to use windows on the server will crush. To protect you for any undefined you must to use window with componentDidMount() More info: |
Using a unique |
Description
When using react-recaptcha in a GatsbyJS project and switching between pages containing the same component with a reCAPTCHA, rendering fails. It also fails when opening a direct link to one of the two pages.
Reproduction
contact-en.js
andcontact-de.js
that both contain the sameContactForm
component which uses react-recaptcha to render a recaptcha.npm i
, thengatsby build && gatsby serve
, then browse tohttp://localhost:9000/contact-de/
to reproduce the error (you may have to hit the refresh button a few times until the error occurrs).Workarounds
onloadCallback
seem to fix the issue ReCAPTCHA placeholder element must be an element or id #181 (comment)Related
The text was updated successfully, but these errors were encountered: