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.

Slate fails in IE11. Objects are not valid as a React child (found: List)

See original GitHub issue

Bug in IE11.

Slate fails in IE because it uses Symbol data type.

I have add this to my webpack config to polyfill Symbol:

config.entries = [
  "core-js/es6/array.js", // because Slate uses Array.prototype.find
  "core-js/es6/symbol.js",
  "core-js/fn/symbol/iterator.js",
  ...
]

But still get an error in IE11.

Objects are not valid as a React child (found: List [ [object Object] ]). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of Node.

I found, it can be fixed by modify Slate’s Node code. We should add .toJS() call

renderText() {
   ...
   return (
     <span data-key={node.key}>
        {leaves.toJS()}
     </span>
    );
   ...
}

Will you approve pull request with this change or easier just make a fork?

Or maybe someone have another idea how to fix it in better way?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kvolkovich-sccommented, Aug 18, 2017

Merged in master. Closed.

1reaction
ianstormtaylorcommented, Aug 16, 2017

@kvolkovich-sc that would be great, thank you! For the find util, can we use lodash/find instead? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Objects are not valid as a react child (In Internet explorer 11 ...
I've resolved this issue by reordering polyfill and react / react-dom to be sure that the polyfill Symbol is loaded before React and...
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 >
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 after converting string to ...
Coding example for the question Objects are not valid as a React child after converting string to DOM-Reactjs.
Read more >
Release Notes | GXT 4.x - Sencha Documentation
[EXTGWT-5543] - When we resize the window, Scroll bar is not working as ... unable to select items with mouse or keyboard navigation...
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