Skip to content

Commit 65d170c

Browse files
committed
doc: Update document.
1 parent 9e69257 commit 65d170c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

website/App.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ import GithubCorner from './components/GithubCorner';
88
import ReactMarkdown from './components/Markdown';
99
import Logo from './Logo';
1010

11-
export default class App extends React.Component {
11+
const DocumentStrSource = DocumentStr.replace(/([\s\S]*)<!--dividing-->/, '').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]*)<!--dividing-->/, '').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} />

0 commit comments

Comments
 (0)