{"action":"created","issue":{"url":"https://api.github.com/repos/JedWatson/react-codemirror/issues/7","labels_url":"https://api.github.com/repos/JedWatson/react-codemirror/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/JedWatson/react-codemirror/issues/7/comments","events_url":"https://api.github.com/repos/JedWatson/react-codemirror/issues/7/events","html_url":"https://github.com/JedWatson/react-codemirror/issues/7","id":94881632,"number":7,"title":" Invariant Violation: addComponentAsRefTo","user":{"login":"dnbard","id":4028472,"avatar_url":"https://avatars.githubusercontent.com/u/4028472?v=3","gravatar_id":"","url":"https://api.github.com/users/dnbard","html_url":"https://github.com/dnbard","followers_url":"https://api.github.com/users/dnbard/followers","following_url":"https://api.github.com/users/dnbard/following{/other_user}","gists_url":"https://api.github.com/users/dnbard/gists{/gist_id}","starred_url":"https://api.github.com/users/dnbard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnbard/subscriptions","organizations_url":"https://api.github.com/users/dnbard/orgs","repos_url":"https://api.github.com/users/dnbard/repos","events_url":"https://api.github.com/users/dnbard/events{/privacy}","received_events_url":"https://api.github.com/users/dnbard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-14T07:03:21Z","updated_at":"2015-08-30T20:48:23Z","closed_at":null,"body":"I've put `react-codemirror` to my project just almost the same as it described in example: \r\n\r\n```\r\nvar JSONBrowserPage = React.createClass({\r\n    getInitialState: function(){\r\n        return {\r\n            options: {\r\n                lineNumbers: true,\r\n                mode: {name: \"javascript\", json: true}\r\n            };\r\n        };\r\n    },\r\n\r\n    render: function(){\r\n        return (\r\n            <Codemirror value={this.props.json} options={this.state.options}/>\r\n        );\r\n    }\r\n});\r\n```\r\n\r\nand got next error:  \r\nUncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/JedWatson/react-codemirror/issues/comments/136187470","html_url":"https://github.com/JedWatson/react-codemirror/issues/7#issuecomment-136187470","issue_url":"https://api.github.com/repos/JedWatson/react-codemirror/issues/7","id":136187470,"user":{"login":"steveluscher","id":13243,"avatar_url":"https://avatars.githubusercontent.com/u/13243?v=3","gravatar_id":"","url":"https://api.github.com/users/steveluscher","html_url":"https://github.com/steveluscher","followers_url":"https://api.github.com/users/steveluscher/followers","following_url":"https://api.github.com/users/steveluscher/following{/other_user}","gists_url":"https://api.github.com/users/steveluscher/gists{/gist_id}","starred_url":"https://api.github.com/users/steveluscher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveluscher/subscriptions","organizations_url":"https://api.github.com/users/steveluscher/orgs","repos_url":"https://api.github.com/users/steveluscher/repos","events_url":"https://api.github.com/users/steveluscher/events{/privacy}","received_events_url":"https://api.github.com/users/steveluscher/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T20:48:23Z","updated_at":"2015-08-30T20:48:23Z","body":"Fixed in #9."}}