File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 1+ [* ]
2+ indent_style = space
3+ end_of_line = lf
4+ indent_size = 2
5+ charset = utf-8
6+ trim_trailing_whitespace = true
7+
8+ [* .md ]
9+ max_line_length = 0
10+ trim_trailing_whitespace = false
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ var SimpleMDE = require('react-simplemde-editor');
5959
6060< SimpleMDE
6161 onChange= {this .handleChange }
62+ value= {this .state .textValue }
6263 options= {{
6364 autofocus: true ,
6465 spellChecker: false ,
65- value: this .state .textValue
6666 // etc.
6767 }}
6868/ >
Original file line number Diff line number Diff line change 11const React = require ( 'react' ) ;
2- const SimpleMDE = require ( 'simplemde/dist/simplemde.min' ) ;
32const generateId = require ( './services/idGenerator' ) ;
43const NOOP = require ( './utils/noop' ) ;
54
@@ -19,7 +18,12 @@ module.exports = React.createClass({
1918 } ,
2019
2120 componentWillMount : function ( ) {
22- this . id = generateId ( ) ;
21+ const id = this . props . id ;
22+ if ( id ) {
23+ this . id = id ;
24+ } else {
25+ this . id = generateId ( ) ;
26+ }
2327 } ,
2428
2529 componentDidMount : function ( ) {
@@ -43,8 +47,10 @@ module.exports = React.createClass({
4347 } ,
4448
4549 createEditor : function ( ) {
50+ const SimpleMDE = require ( 'simplemde/src/js/simplemde.js' ) ;
4651 const initialOptions = {
47- element : document . getElementById ( this . id )
52+ element : document . getElementById ( this . id ) ,
53+ initialValue : this . props . value
4854 } ;
4955
5056 const allOptions = Object . assign ( { } , initialOptions , this . props . options ) ;
You can’t perform that action at this time.
0 commit comments