{"action":"opened","issue":{"url":"https://api.github.com/repos/ForbesLindesay/react-code-mirror/issues/17","labels_url":"https://api.github.com/repos/ForbesLindesay/react-code-mirror/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/ForbesLindesay/react-code-mirror/issues/17/comments","events_url":"https://api.github.com/repos/ForbesLindesay/react-code-mirror/issues/17/events","html_url":"https://github.com/ForbesLindesay/react-code-mirror/issues/17","id":124575772,"number":17,"title":"Requiring the CodeMirror Mode","user":{"login":"rgbkrk","id":836375,"avatar_url":"https://avatars.githubusercontent.com/u/836375?v=3","gravatar_id":"","url":"https://api.github.com/users/rgbkrk","html_url":"https://github.com/rgbkrk","followers_url":"https://api.github.com/users/rgbkrk/followers","following_url":"https://api.github.com/users/rgbkrk/following{/other_user}","gists_url":"https://api.github.com/users/rgbkrk/gists{/gist_id}","starred_url":"https://api.github.com/users/rgbkrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgbkrk/subscriptions","organizations_url":"https://api.github.com/users/rgbkrk/orgs","repos_url":"https://api.github.com/users/rgbkrk/repos","events_url":"https://api.github.com/users/rgbkrk/events{/privacy}","received_events_url":"https://api.github.com/users/rgbkrk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-02T05:12:51Z","updated_at":"2016-01-02T05:12:51Z","closed_at":null,"body":"In the example you show `require`ing the mode in your index.js, before `React` gets its hands on the `CodeMirror` component. For my case, I need to be able to set the mode dynamically. The way I'm doing this for the component that has a CodeMirror instance is to require the mode in `componentWillMount`. This works for me, especially since I have multiple CodeMirror instances on the page, though I'm wondering if maybe there's a better approach."}}