File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -9,24 +9,14 @@ import CSSModules from 'browser/lib/CSSModules'
99class MarkdownSplitEditor extends React . Component {
1010 constructor ( props ) {
1111 super ( props )
12- this . state = {
13- value : props . value
14- }
1512 this . value = props . value
1613 this . focus = ( ) => this . refs . code . focus ( )
1714 this . reload = ( ) => this . refs . code . reload ( )
1815 }
1916
20- componentWillReceiveProps ( props ) {
21- this . setState ( { value : props . value } )
22- }
23-
2417 handleOnChange ( ) {
25- const value = this . refs . code . value
26- this . setState ( { value } , ( ) => {
27- this . value = value
28- this . props . onChange ( )
29- } )
18+ this . value = this . refs . code . value
19+ this . props . onChange ( )
3020 }
3121
3222 handleCheckboxClick ( e ) {
@@ -53,8 +43,7 @@ class MarkdownSplitEditor extends React.Component {
5343 }
5444
5545 render ( ) {
56- const { config, storageKey } = this . props
57- const { value } = this . state
46+ const { config, value, storageKey } = this . props
5847 const storage = findStorage ( storageKey )
5948 const previewStyle = { }
6049 if ( this . props . ignorePreviewPointerEvents ) previewStyle . pointerEvents = 'none'
You can’t perform that action at this time.
0 commit comments