{"action":"closed","issue":{"url":"https://api.github.com/repos/glenjamin/react-hotkey/issues/4","labels_url":"https://api.github.com/repos/glenjamin/react-hotkey/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/glenjamin/react-hotkey/issues/4/comments","events_url":"https://api.github.com/repos/glenjamin/react-hotkey/issues/4/events","html_url":"https://github.com/glenjamin/react-hotkey/issues/4","id":85719747,"number":4,"title":"react-hotkey doesn't work","user":{"login":"iambusybox","id":12772578,"avatar_url":"https://avatars.githubusercontent.com/u/12772578?v=3","gravatar_id":"","url":"https://api.github.com/users/iambusybox","html_url":"https://github.com/iambusybox","followers_url":"https://api.github.com/users/iambusybox/followers","following_url":"https://api.github.com/users/iambusybox/following{/other_user}","gists_url":"https://api.github.com/users/iambusybox/gists{/gist_id}","starred_url":"https://api.github.com/users/iambusybox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iambusybox/subscriptions","organizations_url":"https://api.github.com/users/iambusybox/orgs","repos_url":"https://api.github.com/users/iambusybox/repos","events_url":"https://api.github.com/users/iambusybox/events{/privacy}","received_events_url":"https://api.github.com/users/iambusybox/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-06T07:53:36Z","updated_at":"2015-08-30T13:51:54Z","closed_at":"2015-08-30T13:51:54Z","body":"I'm trying to use a mixin you made - react-hotkey - but it doesn't work in my project.\r\n\r\n....\r\nvar hotkey = require('react-hotkey').activate();\r\n\r\nvar LoginBody = React.createClass({\r\n  mixins: [ReactRouter.State, ReactRouter.Navigation, hotkey.Mixin('handleHotkey')],\r\n\r\n  handleHotkey: function(e) {\r\n        // receives a React Keyboard Event\r\n        // http://facebook.github.io/react/docs/events.html#keyboard-events\r\n        alert('key = ' + e.keyCode);\r\n  },\r\n...\r\n\r\nOnce I've started the application I've got an exception:\r\n\r\nD:\\Smart\\node_modules\\react-hotkey\\index.js:13\r\n        documentListener = EventListener.listen(document, event, handle);\r\n                                                ^\r\nReferenceError: document is not defined\r\n    at Object.exports.activate (D:\\Smart\\node_modules\\react-hotkey\\index.js:13:49)\r\n    at D:\\Smart\\node_modules\\jsx-loader\\index.js?harmony!D:\\Smart\\src\\jsx\\smart\\routes\\login.jsx:6:38\r\n    at NormalModuleMixin.Module._compile (D:\\Smart\\node_modules\\enhanced-require\\lib\\Module.js:53:18)\r\n    at RequireContext.theRequire (D:\\Smart\\node_modules\\enhanced-require\\lib\\RequireContext.js:169:10)\r\n    at D:\\Smart\\node_modules\\jsx-loader\\index.js?harmony!D:\\Smart\\src\\jsx\\smart\\routes.jsx:11:21\r\n    at NormalModuleMixin.Module._compile (D:\\Smart\\node_modules\\enhanced-require\\lib\\Module.js:53:18)\r\n    at RequireContext.theRequire (D:\\Smart\\node_modules\\enhanced-require\\lib\\RequireContext.js:169:10)\r\n    at D:\\Smart\\node_modules\\jsx-loader\\index.js?harmony!D:\\Smart\\server.jsx:36:14\r\n    at NormalModuleMixin.Module._compile (D:\\Smart\\node_modules\\enhanced-require\\lib\\Module.js:53:18)\r\n    at RequireContext.theRequire (D:\\Smart\\node_modules\\enhanced-require\\lib\\RequireContext.js:169:10)\r\n\r\nReact version is 0.12.2\r\n\r\nWhat I'm doing wrong?\r\n\r\n\r\n\r\nBy the way, the following code works very well:\r\n\r\n...\r\ncomponentDidMount: function() {    \r\n    $(document.body).on('keydown', this.handleKeyDown);\r\n  },\r\n  componentWillUnmount: function() {\r\n    $(document.body).off('keydown', this.handleKeyDown);\r\n  },\r\n\r\nhandleKeyDown: function(e) {\r\n    alert('key = ' + e.keyCode);\r\n  },\r\n\r\n\r\nBut I would like to use your mixin.\r\n\r\nThank you in advance for any response."}}