Slate fails in IE11. Objects are not valid as a React child (found: List)
See original GitHub issueBug 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:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Merged in master. Closed.
@kvolkovich-sc that would be great, thank you! For the
find
util, can we uselodash/find
instead? Thanks!