File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,20 @@ import GithubCorner from './components/GithubCorner';
88import ReactMarkdown from './components/Markdown' ;
99import Logo from './Logo' ;
1010
11- export default class App extends React . Component {
11+ const DocumentStrSource = DocumentStr . replace ( / ( [ \s \S ] * ) < ! - - d i v i d i n g - - > / , '' ) . replace ( / ^ \n * / g, '' ) ;
12+
13+ interface IAppState {
14+ mdstr : string ;
15+ }
16+
17+ export default class App extends React . Component < any , IAppState > {
18+ constructor ( props : any ) {
19+ super ( props ) ;
20+ this . state = {
21+ mdstr : DocumentStrSource ,
22+ }
23+ }
1224 public render ( ) {
13- const DocumentStrSource = DocumentStr . replace ( / ( [ \s \S ] * ) < ! - - d i v i d i n g - - > / , '' ) . replace ( / ^ \n * / g, '' ) ;
1425 return (
1526 < div className = { styles . warpper } >
1627 < GithubCorner url = "https://github.com/uiwjs/react-markdown-editor" />
@@ -24,7 +35,7 @@ export default class App extends React.Component {
2435 showCursorWhenSelecting : true ,
2536 } }
2637 height = { 500 }
27- value = { DocumentStrSource }
38+ value = { this . state . mdstr }
2839 />
2940 </ div >
3041 < ReactMarkdown source = { DocumentStrSource } className = { styles . doc } />
You can’t perform that action at this time.
0 commit comments