I have this problem where I'm trying to render a HTMLDivElement using React, however I get the following error:
Uncaught Invariant Violation: Objects are not valid as a React child (found: [object HTMLDivElement]). 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 `VirtualList`
In my React Component class I have this code...
import React, { Component } from 'react';
export default class VirtualList extends Component {
constructor(props) {
super(props);
this.container = document.createElement('div');
}
renderList() {
let container = this.container;
// Manipulate container etc.
return container;
}
render() {
return (
{this.renderList()}
)
}
}
Help would be much appreciated!