Skip to content

Commit f0bdca2

Browse files
committed
Document all props
1 parent 9517265 commit f0bdca2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,19 @@ You can interact with the CodeMirror instance using a `ref` and the `getCodeMirr
8585

8686
### Properties
8787

88+
* `autoFocus` `Boolean` automatically focuses the editor when it is mounted (default false)
8889
* `autoSave` `Boolean` automatically persist changes to underlying textarea (default false)
89-
* `value` `String` the editor value
90-
* `preserveScrollPosition` `Boolean=false` Preserve previous scroll position after updating value
90+
* `className` `String` adds a custom css class to the editor
91+
* `codeMirrorInstance` `Function` provides a specific CodeMirror instance (defaults to `require('codemirror')`)
92+
* `defaultValue` `String` provides a default (not change tracked) value to the editor
93+
* `name` `String` sets the name of the editor input field
9194
* `options` `Object` options passed to the CodeMirror instance
9295
* `onChange` `Function (newValue)` called when a change is made
96+
* `onCursorActivity` `Function (codemirror)` called when the cursor is moved
9397
* `onFocusChange` `Function (focused)` called when the editor is focused or loses focus
98+
* `onScroll` `Function (scrollInfo)` called when the editor is scrolled
99+
* `preserveScrollPosition` `Boolean=false` preserve previous scroll position after updating value
100+
* `value` `String` the editor value
94101

95102
See the [CodeMirror API Docs](https://codemirror.net/doc/manual.html#api) for the available options.
96103

0 commit comments

Comments
 (0)