{"action":"created","issue":{"url":"https://api.github.com/repos/troybetz/react-youtube/issues/92","repository_url":"https://api.github.com/repos/troybetz/react-youtube","labels_url":"https://api.github.com/repos/troybetz/react-youtube/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/troybetz/react-youtube/issues/92/comments","events_url":"https://api.github.com/repos/troybetz/react-youtube/issues/92/events","html_url":"https://github.com/troybetz/react-youtube/issues/92","id":189786702,"number":92,"title":"Need help with es5","user":{"login":"AmenRa666","id":11797097,"avatar_url":"https://avatars.githubusercontent.com/u/11797097?v=3","gravatar_id":"","url":"https://api.github.com/users/AmenRa666","html_url":"https://github.com/AmenRa666","followers_url":"https://api.github.com/users/AmenRa666/followers","following_url":"https://api.github.com/users/AmenRa666/following{/other_user}","gists_url":"https://api.github.com/users/AmenRa666/gists{/gist_id}","starred_url":"https://api.github.com/users/AmenRa666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmenRa666/subscriptions","organizations_url":"https://api.github.com/users/AmenRa666/orgs","repos_url":"https://api.github.com/users/AmenRa666/repos","events_url":"https://api.github.com/users/AmenRa666/events{/privacy}","received_events_url":"https://api.github.com/users/AmenRa666/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-16T17:44:45Z","updated_at":"2016-11-16T17:52:18Z","closed_at":null,"body":"Hi, I have some problems using the component in es5.\r\nI am using latest version and this is my code:\r\n\r\n```\r\nvar React = require('react')\r\nvar YouTube = require('react-youtube').YouTube\r\n\r\nmodule.exports = React.createClass({\r\n  render: function() {\r\n    var opts = {\r\n      height: '390',\r\n      width: '640',\r\n      playerVars: {\r\n        autoplay: 1\r\n      }\r\n    };\r\n\r\n    return (\r\n      <YouTube\r\n        videoId=\"2g811Eo7K8U\"\r\n        opts={opts}\r\n        onReady={this._onReady}\r\n      />\r\n    );\r\n  },\r\n\r\n  _onReady(event) {\r\n    // access to player in all event handlers via event.target\r\n    event.target.pauseVideo();\r\n  }\r\n});\r\n\r\n```\r\n\r\nIf I replace this with a random div everything is smooth:\r\n\r\n```\r\n<YouTube\r\n    videoId=\"2g811Eo7K8U\"\r\n    opts={opts}\r\n    onReady={this._onReady}\r\n/>\r\n```\r\nBut with the code above I get this error:\r\n```\r\nWarning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of `module.exports`.\r\nInvariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `module.exports`.\r\n    at invariant (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/node_modules/fbjs/lib/invariant.js:39:15)\r\n    at instantiateReactComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/instantiateReactComponent.js:64:134)\r\n    at instantiateChild (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactChildReconciler.js:29:28)\r\n    at traverseAllChildrenImpl (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/traverseAllChildren.js:98:5)\r\n    at traverseAllChildren (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/traverseAllChildren.js:186:10)\r\n    at Object.instantiateChildren (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactChildReconciler.js:52:5)\r\n    at ReactDOMComponent._reconcilerInstantiateChildren (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactMultiChild.js:197:41)\r\n    at ReactDOMComponent.mountChildren (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactMultiChild.js:232:27)\r\n    at ReactDOMComponent._createContentMarkup (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactDOMComponent.js:591:32)\r\n    at ReactDOMComponent.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactDOMComponent.js:479:29)\r\n    at Object.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactReconciler.js:37:35)\r\n    at ReactCompositeComponentWrapper.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactCompositeComponent.js:225:34)\r\n    at ReactCompositeComponentWrapper.wrapper [as mountComponent] (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactPerf.js:66:21)\r\n    at Object.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactReconciler.js:37:35)\r\n    at ReactDOMComponent.mountChildren (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactMultiChild.js:241:44)\r\n    at ReactDOMComponent._createContentMarkup (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactDOMComponent.js:591:32)\r\n    at ReactDOMComponent.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactDOMComponent.js:479:29)\r\n    at Object.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactReconciler.js:37:35)\r\n    at ReactCompositeComponentWrapper.mountComponent (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactCompositeComponent.js:225:34)\r\n    at ReactCompositeComponentWrapper.wrapper [as mountComponent] (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactPerf.js:66:21)\r\n    at /Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/ReactServerRendering.js:42:38\r\n    at ReactServerRenderingTransaction.perform (/Volumes/Mac Data/Users/Elias/artistid2/node_modules/react/lib/Transaction.js:136:20)\r\n```\r\n\r\nCan you help me?\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/troybetz/react-youtube/issues/comments/261019578","html_url":"https://github.com/troybetz/react-youtube/issues/92#issuecomment-261019578","issue_url":"https://api.github.com/repos/troybetz/react-youtube/issues/92","id":261019578,"user":{"login":"goto-bus-stop","id":1006268,"avatar_url":"https://avatars.githubusercontent.com/u/1006268?v=3","gravatar_id":"","url":"https://api.github.com/users/goto-bus-stop","html_url":"https://github.com/goto-bus-stop","followers_url":"https://api.github.com/users/goto-bus-stop/followers","following_url":"https://api.github.com/users/goto-bus-stop/following{/other_user}","gists_url":"https://api.github.com/users/goto-bus-stop/gists{/gist_id}","starred_url":"https://api.github.com/users/goto-bus-stop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goto-bus-stop/subscriptions","organizations_url":"https://api.github.com/users/goto-bus-stop/orgs","repos_url":"https://api.github.com/users/goto-bus-stop/repos","events_url":"https://api.github.com/users/goto-bus-stop/events{/privacy}","received_events_url":"https://api.github.com/users/goto-bus-stop/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T17:52:18Z","updated_at":"2016-11-16T17:52:18Z","body":"```js\r\nvar YouTube = require('react-youtube').default\r\n```\r\n\r\n… should work :)"}}
{"actor":{"display_login":"goto-bus-stop"}}