{"action":"created","issue":{"url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline/issues/21","repository_url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline","labels_url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline/issues/21/comments","events_url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline/issues/21/events","html_url":"https://github.com/Lighthouse-io/react-visjs-timeline/issues/21","id":235031040,"number":21,"title":"Is it possible to use interactive React components as Items & Groups","user":{"login":"1vanhelsing1","id":5320436,"avatar_url":"https://avatars1.githubusercontent.com/u/5320436?v=4","gravatar_id":"","url":"https://api.github.com/users/1vanhelsing1","html_url":"https://github.com/1vanhelsing1","followers_url":"https://api.github.com/users/1vanhelsing1/followers","following_url":"https://api.github.com/users/1vanhelsing1/following{/other_user}","gists_url":"https://api.github.com/users/1vanhelsing1/gists{/gist_id}","starred_url":"https://api.github.com/users/1vanhelsing1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1vanhelsing1/subscriptions","organizations_url":"https://api.github.com/users/1vanhelsing1/orgs","repos_url":"https://api.github.com/users/1vanhelsing1/repos","events_url":"https://api.github.com/users/1vanhelsing1/events{/privacy}","received_events_url":"https://api.github.com/users/1vanhelsing1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-06-10T22:39:39Z","updated_at":"2018-02-05T09:50:55Z","closed_at":null,"author_association":"NONE","body":"From the vis documentation shows that React components can be used as templates for Items and Groups. However, I can't seem to get anything to send data out - ie clicking an item to trigger a Redux action. Is the React component only able to function as normal when used as an Item by specifying the template function like in the examples:\r\n```\r\n template: function (item, element) {\r\n      if (!item) { return }\r\n      ReactDOM.unmountComponentAtNode(element);\r\n      return ReactDOM.render(<Item item={item} />, element);\r\n  },\r\n```\r\nItem looks like this\r\n```\r\nclass Item extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.onClick = this.onClick.bind(this);\r\n  }\r\n\r\n  onClick(event) {\r\n    console.log(\"click\");\r\n    // this.props.dispatch()\r\n  }\r\n\r\n  render() {\r\n   \r\n    return (\r\n      <div style={{width:'20px', height:'20px'}}>\r\n        <button style={{width:'70px', height:'50px'}} onClick={this.onClick} type=\"button\">Click</button>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n```\r\nThe strange thing is, the onClick handler never executes when clicking on the button, but _does_ trigger when the item is dragged on the timeline\r\n"},"comment":{"url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline/issues/comments/363033434","html_url":"https://github.com/Lighthouse-io/react-visjs-timeline/issues/21#issuecomment-363033434","issue_url":"https://api.github.com/repos/Lighthouse-io/react-visjs-timeline/issues/21","id":363033434,"user":{"login":"xiorcal","id":2391639,"avatar_url":"https://avatars1.githubusercontent.com/u/2391639?v=4","gravatar_id":"","url":"https://api.github.com/users/xiorcal","html_url":"https://github.com/xiorcal","followers_url":"https://api.github.com/users/xiorcal/followers","following_url":"https://api.github.com/users/xiorcal/following{/other_user}","gists_url":"https://api.github.com/users/xiorcal/gists{/gist_id}","starred_url":"https://api.github.com/users/xiorcal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiorcal/subscriptions","organizations_url":"https://api.github.com/users/xiorcal/orgs","repos_url":"https://api.github.com/users/xiorcal/repos","events_url":"https://api.github.com/users/xiorcal/events{/privacy}","received_events_url":"https://api.github.com/users/xiorcal/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T09:50:55Z","updated_at":"2018-02-05T09:50:55Z","author_association":"NONE","body":"+1"}}
{"actor":{"display_login":"xiorcal"}}