JSPM

  • Created
  • Published
  • Downloads 248768
  • Score
    100M100P100Q170305F
  • License MIT

a tiny react codemirror component wrapper

Package Exports

  • react-codemirror2

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-codemirror2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status Dependency Status DevDependency Status NPM Version

react-codemirror2

clone, install, and run the redux demo on localhost:8000. Crude & very limited - better examples coming coon

npm start

better docs coming soon. all props are optional...

import CodeMirror from 'react-codemirror2'

<CodeMirror
  defaultValue='I <3 react-codemirror2'
  options={{
    theme: this.props.theme,
    lineNumbers: true
  }}
  editorWillMount={(codemirror) => {
  }}
  editorDidMount={(editor, next) => {

    editor.setOption('htmlMode', true); // alternative to passing props
    next(); // optional: will trigger editorDidConfigure
  }}
  editorDidConfigure={(editor) => {
  }}
  editorWillUnmount={(editor) => {
  }}
  onSetDefaultValue={(defaultValue) => {
  }}
  onChange={(editor, metadata, internalValue) => {

    console.log(internalValue); // editor value
  }}
  onCursorActivity={() => {
  }}
  onViewportChange={(editor, viewportStart, viewportEnd) => {
  }}
  onGutterClick={(editor, lineNumber, event) => {
  }}
  onFocus={() => {
  }}
  onBlur={() => {
  }}
  onScroll={() => {
  }}
  onUpdate={() => {
  }}
  onKeyDown={(editor, event) => {
  }}
  onKeyUp={(editor, event) => {
  }}
  onKeyPress={(editor, event) => {
  }}
  onDragEnter={(editor, event) => {
  }}
  onDragOver={(editor, event) => {
  }}
  onDrop={(editor, event) => {
  }}
/>