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.

Importing Poly (babel-polyfill,core.js symbol,es6-symbol) Crashes app on load - Objects are not valid as React child

See original GitHub issue

There might be something to learn from this issue even if it is not the same maybe its a similar loading issue? https://github.com/facebook/react-native/pull/15182

I tried to use Symbol in my local project but none of the poly’s I found work they all crash RN when I try to run even the simplest app with Objects are not valid as React child reconcileChIldFibers throws InvalidObjectType line 8348:31 (ReactNativeRenderer - dev.js)

Environment

Environment: OS: Linux 4.15 Node: 8.10.0 Yarn: 1.5.1 npm: 5.6.0 Watchman: Not Found Xcode: N/A Android Studio: Not Found

Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.3 react-native: 0.54.2 => 0.54.2

Steps to Reproduce

react-native init rnsymboleish cd rnsymboleish npm install --save babel-polyfill (or npm install --save es6-symbol) npm install

—App.js

import 'babel-polyfill';   //---> or //'es6-symbol/implement' //'core-js/es6/symbol';
import React, { Component } from 'react';
import { Text, View} from 'react-native';
  
export default class App extends Component {
  render() {
    return (
      <View>
        <Text>
          Eish
        </Text>
      </View>
    );
  }
}

react-native run-android

Expected Behavior

Thought it would not crash…?

Actual Behavior

3-24 19:14:45.728 30769 31013 I ReactNativeJS: Running application “rnsymbolwtf” with appParams: {“rootTag”:1}. DEV === true, development-level warning are ON, performance optimizations are OFF 03-24 19:14:45.748 30769 31013 E ReactNativeJS: Invariant Violation: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead. 03-24 19:14:45.748 30769 31013 E ReactNativeJS: 03-24 19:14:45.748 30769 31013 E ReactNativeJS: This error is located at: 03-24 19:14:45.818 30769 31013 E ReactNativeJS: Invariant Violation: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead. 03-24 19:14:45.818 30769 31013 E ReactNativeJS: 03-24 19:14:45.818 30769 31013 E ReactNativeJS: This error is located at:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:26 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
ronhecommented, Apr 18, 2018

Moving import 'core-js/es6/symbol'; to the top of index.js solved the problem for me.

4reactions
cpojercommented, Jan 29, 2019

It seems like there are enough workarounds for this to consider the issue resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving Error: "Objects are not valid as a React child"
This component illustrates the common cases that cause this error as well as examples of valid React children. TypeScript. import React from " ......
Read more >
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 >
Reactjs:Objects are not valid as a React child - Stack Overflow
The error is pretty clear, you are, somewhere in that code, returning a Javascript object inside the render functions. My advice?
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 >
Fix "Objects are not valid as a React child" error in React
While writing React applications, you may have come across the error message "objects are not valid as a react child." This error is...
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