question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

recaptcha error render

See original GitHub issue

react 15.03 react-google-recaptcha 0.8.1

in my file:

const ReCAPTCHA = require('react-google-recaptcha/lib/recaptcha')


render() {
  <div className="login">
    ...
    <ReCAPTCHA ref="recaptcha"
                                  size="normal"
                                  onChange={(e) => this.test(e)}
                                  sitekey="[SITE_KEY]"/>
  </div>
}

the error:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render 

Did I miss some config or It have to render by any special way?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dozoischcommented, Sep 12, 2017

Might have to do const ReCAPTCHA = require('react-google-recaptcha').default

If you import with require. Otherwise

import ReCAPTCHA from 'react-google-recaptcha';

should work

0reactions
dieuit07commented, Sep 12, 2017

Sure stevematdavies. Still not work, I have moved to other lib. Thanks Guys

Read more comments on GitHub >

github_iconTop Results From Across the Web

My recaptcha render doesn't work and return 0 - Stack Overflow
As far as I know 0 is a valid response to the render event, i.e. the widget ID is an integer starting at...
Read more >
reCAPTCHA v2 - Google Developers
The easiest method for rendering the reCAPTCHA widget on your page is to include the necessary JavaScript resource and a g-recaptcha tag.
Read more >
Error: ReCAPTCHA has already been rendered in ... - GitHub
The problem is that DOM generated by this.props.grecaptcha.render() is not removed during <ReCAPTCHA 's unmount and therefore can cause trouble ...
Read more >
Error: Unable to load the reCAPTCHA image. The public key ...
render is not a function Captcha.js:100:28 ". This error may still occur even after resetting the private and public keys within NetCommunity. Answer:....
Read more >
reCAPTCHA has already been rendered in this element
I have problem with Google ReCAPTCHA asset Consumption in my Application, where it throws a console log error on click of the Hamburger...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found