Lighthouse-io / react-visjs-timeline

React component for the vis.js timeline module
MIT License
210 stars 91 forks source link

dataSet in react component #94

Open lilworks opened 5 years ago

lilworks commented 5 years ago

I'm completly noob in react. I'm trying to use a react object to set the items

var Items = createReactClass({
  render: function() {
    return new vis.DataSet();
  }
})

After in my ReactDOM.render ReactDOM.render(<Timeline options={options} items=<Items/> />, document.getElementById('timeline'));

I'm getting this error.

Warning: Failed prop type: Invalid prop `items` of type `object` supplied to `Timeline`, expected `array`.
    in Timeline

How Can I pass my items to the ReactDOM.render()?