Skip to content

Commit 62d5d25

Browse files
committed
fix: extract instantiation of Remarkable
1 parent c9b76e9 commit 62d5d25

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

content/home/examples/a-component-using-external-plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class MarkdownEditor extends React.Component {
22
constructor(props) {
33
super(props);
4+
this.md = new Remarkable();
45
this.handleChange = this.handleChange.bind(this);
56
this.state = { value: 'Hello, **world**!' };
67
}
@@ -10,8 +11,7 @@ class MarkdownEditor extends React.Component {
1011
}
1112

1213
getRawMarkup() {
13-
const md = new Remarkable();
14-
return { __html: md.render(this.state.value) };
14+
return { __html: this.md.render(this.state.value) };
1515
}
1616

1717
render() {

0 commit comments

Comments
 (0)