File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,17 @@ var MarkdownEditor = React.createClass({\n\
1111 getInitialState: function() {\n\
1212 return {value: 'Type some *markdown* here!'};\n\
1313 },\n\
14- handleInput : React.autoBind(function() {\n\
14+ handleChange : React.autoBind(function() {\n\
1515 this.setState({value: this.refs.textarea.getDOMNode().value});\n\
1616 }),\n\
1717 render: function() {\n\
1818 return (\n\
1919 <div className=\"MarkdownEditor\">\n\
2020 <h3>Input</h3>\n\
21- <textarea onInput={this.handleInput} ref=\"textarea\">\n\
22- {this.state.value}\n\
23- </textarea>\n\
21+ <textarea\n\
22+ onChange={this.handleChange}\n\
23+ ref=\"textarea\"\n\
24+ defaultValue={this.state.value} />\n\
2425 <h3>Output</h3>\n\
2526 <div\n\
2627 className=\"content\"\n\
@@ -37,6 +38,6 @@ React.renderComponent(<MarkdownEditor />, mountNode);\
3738" ;
3839
3940React . renderComponent (
40- < ReactPlayground codeText = { MARKDOWN_COMPONENT } /> ,
41+ ReactPlayground ( { codeText : MARKDOWN_COMPONENT } , null ) ,
4142 document . getElementById ( 'markdownExample' )
4243) ;
You can’t perform that action at this time.
0 commit comments