{"action":"created","issue":{"url":"https://api.github.com/repos/jeffcarp/braintree-react/issues/10","labels_url":"https://api.github.com/repos/jeffcarp/braintree-react/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/jeffcarp/braintree-react/issues/10/comments","events_url":"https://api.github.com/repos/jeffcarp/braintree-react/issues/10/events","html_url":"https://github.com/jeffcarp/braintree-react/issues/10","id":105835691,"number":10,"title":"'Undefined is not an object' Error when rendering DropIn component","user":{"login":"rbsmidt","id":5921601,"avatar_url":"https://avatars.githubusercontent.com/u/5921601?v=3","gravatar_id":"","url":"https://api.github.com/users/rbsmidt","html_url":"https://github.com/rbsmidt","followers_url":"https://api.github.com/users/rbsmidt/followers","following_url":"https://api.github.com/users/rbsmidt/following{/other_user}","gists_url":"https://api.github.com/users/rbsmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/rbsmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbsmidt/subscriptions","organizations_url":"https://api.github.com/users/rbsmidt/orgs","repos_url":"https://api.github.com/users/rbsmidt/repos","events_url":"https://api.github.com/users/rbsmidt/events{/privacy}","received_events_url":"https://api.github.com/users/rbsmidt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-10T15:35:54Z","updated_at":"2015-09-10T20:47:06Z","closed_at":null,"body":"Hi there.\r\nI'm trying to test braintree-react in a project, but i keep getting an error when trying to render the DropIn-component:\r\n\r\n    undefined is not an object (evaluating 'deepestAncestor.firstChild')\r\n\r\nI'm bundling my project with WebPack, and installed braintree react via NPM. I then pretty much followed the code from the repo's example:\r\n\r\n    // BrainTree x React\r\n    var DropIn = require('braintree-react').DropIn;\r\n    var braintree = require('braintree-web');\r\n\r\nAnd then when i want to render the Drop-in:\r\n\r\n    <div className=\"dropin-wrapper\">\r\n        <DropIn braintree={braintree} clientToken={this.props.token} rootClassName=\"dropin-wrapper\" />\r\n    </div>\r\n\r\n... Where this.props.token is a token returned from my backend and generated with Braintree API.\r\nIf i examine the stacktrace through the browser console, the error leads me to this line in my main.js bundled by WebPack:\r\n\r\n    } finally {\r\n        this._isInTransaction = false;\r\n    }\r\n\r\nIam using React with addons and React Router in my application as well. Any idea, what could cause this error?\r\n\r\nFull stack trace from the browser looks like this:\r\n    [Error] TypeError: undefined is not an object (evaluating 'deepestAncestor.firstChild')\r\n\tperform (main.js, line 5406)\r\n\tbatchedUpdates (main.js, line 16519)\r\n\tenqueueUpdate (main.js, line 4021)\r\n\tenqueueUpdate (main.js, line 3440)\r\n\tenqueueSetState (main.js, line 3618)\r\n\tsetState (main.js, line 3322)\r\n\t(anonymous function) (main.js, line 197)\r\n\t(anonymous function) ([native code], line 0)\r\n\tfire (jquery-1.11.3.js, line 3148)\r\n\tfireWith (jquery-1.11.3.js, line 3260)\r\n\tdone (jquery-1.11.3.js, line 9314)\r\n\tcallback (jquery-1.11.3.js, line 9718)"},"comment":{"url":"https://api.github.com/repos/jeffcarp/braintree-react/issues/comments/139374354","html_url":"https://github.com/jeffcarp/braintree-react/issues/10#issuecomment-139374354","issue_url":"https://api.github.com/repos/jeffcarp/braintree-react/issues/10","id":139374354,"user":{"login":"jeffcarp","id":916028,"avatar_url":"https://avatars.githubusercontent.com/u/916028?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffcarp","html_url":"https://github.com/jeffcarp","followers_url":"https://api.github.com/users/jeffcarp/followers","following_url":"https://api.github.com/users/jeffcarp/following{/other_user}","gists_url":"https://api.github.com/users/jeffcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffcarp/subscriptions","organizations_url":"https://api.github.com/users/jeffcarp/orgs","repos_url":"https://api.github.com/users/jeffcarp/repos","events_url":"https://api.github.com/users/jeffcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jeffcarp/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T20:47:06Z","updated_at":"2015-09-10T20:47:06Z","body":"Hey @rbsmidt, braintree-react used to bundle all of React but it no longer does. My only idea is that the dual-loading could have something to do with this line: https://github.com/jeffcarp/braintree-react/blob/master/lib/dropin.js#L6\r\n\r\nCan you try removing `global.React` so the function looks like:\r\n\r\n```js\r\nfunction getReact() {\r\n  return require('react');\r\n}\r\n```\r\n\r\nAnd see if that improves things?"}}