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.

Objects are not valid as a React child Error

See original GitHub issue

Hi, 2 days ago, it works perfectly fine, but today I run my project again and this happens:

Objects are not valid as a React child (found: object with keys {$$typeof, render, displayName, propTypes, sitekey, onChange}). If you meant to render a collection of children, use an array instead. in wrapWithAsyncScript (at LoginModal.js:152) in div (at LoginModal.js:147) in LoginModal (at Authentication.js:30) in div (at Authentication.js:28) in Authentication (created by Form(Authentication)) in Form(Authentication) (at App.js:8) in App (at index.js:7)

I swear to God that I changed nothing since the day it worked. I tried to implement only the recaptcha in a new empty project and it still happens, here is my code:

<div>
  <ReCAPTCHA
    sitekey="My Code"
    onChange={() => {}}
  />
</div>

Is there anything wrong with the library ? I’m using React version 16.4.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
DavidHollins6commented, Aug 21, 2018

That seems to have fixed that issue, thanks for the speedy reply!

However, I am now getting this.

image

I’m unsure if it’s a “me” issue but it started occurring after updating to version 0.14.1.

2reactions
dozoischcommented, Aug 21, 2018

Ah found the issue, it’s because it’s using 1.0.0 from react-async-script instead of the pre 1.0 because the range was too vast… I’ll release a 0.14.1 to fix that.

In the mean time add "react-async-script": "0.11.1" if you are running < 1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding the "Objects are not valid as a react child" Error ...
The "Objects are not valid as a React child" error happens when trying to render a collection of data by mistakenly returning the...
Read more >
Invariant Violation: Objects are not valid as a React child
This error usually happens because a function involved in dispatching an event has been given an unexpected object type (i.e passing an object...
Read more >
Fix "Objects are not valid as a React child" error in React
The "objects are not valid as a react child" error is thrown when you try to pass an object directly to a React...
Read more >
Resolving Error: "Objects are not valid as a React child"
As the error message states, React cannot render objects as children directly. If you are seeing this error, there is a good chance...
Read more >
Objects are not valid as a React child React error | bobbyhadz
The React.js error "Objects are not valid as a React child" occurs when we try to directly render an object or an array...
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