From c41fa408e7adbc9bf4e7d5cc9db15d6203583d4e Mon Sep 17 00:00:00 2001 From: nehardt Date: Wed, 21 Sep 2016 14:25:19 -0700 Subject: [PATCH 1/2] Dev-depend on browserify-optional I was getting error `Browserify Error { [Error: Cannot find module 'browserify-optional' from '[redacted]/react-codemirror/node_modules/react-dom-polyfill']` --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 66cb0d7..2908e50 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "lodash.debounce": "^4.0.8" }, "devDependencies": { + "browserify-optional": "^1.0.0", "gulp": "^3.9.1", "happiness": "^7.1.2", "react": "^15.3.1", From 141662d14499adfcd358880554bc96b26519bc3b Mon Sep 17 00:00:00 2001 From: nehardt Date: Wed, 21 Sep 2016 16:43:32 -0700 Subject: [PATCH 2/2] Document CSS requirement https://github.com/JedWatson/react-codemirror/issues/59 --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 486f657..5a32263 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ npm install react-codemirror --save ## Usage +Require the Codemirror component render it with JSX: ```javascript var React = require('react'); var Codemirror = require('react-codemirror'); @@ -56,6 +57,11 @@ var App = React.createClass({ React.render(, document.getElementById('app')); ``` +Add the Codemirror CSS to your styles (easy to do with a LESS import): +```less +@import (inline) "../../node_modules/codemirror/lib/codemirror.css"; +``` + ### Methods * `focus` focuses the CodeMirror instance @@ -97,6 +103,6 @@ require('codemirror/mode/markdown/markdown'); See the [example source](https://github.com/JedWatson/react-codemirror/blob/master/example/src/example.js) for a reference implementation including JavaScript and markdown syntax highlighting. -### License +## License MIT. Copyright (c) 2016 Jed Watson.