Skip to content

Commit 150a055

Browse files
committed
Update to match changes on website
facebook/react#4931
1 parent 2661991 commit 150a055

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

public/scripts/example.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@
1111
*/
1212

1313
var Comment = React.createClass({
14-
render: function() {
14+
rawMarkup: function() {
1515
var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
16+
return { __html: rawMarkup };
17+
},
18+
19+
render: function() {
1620
return (
1721
<div className="comment">
1822
<h2 className="commentAuthor">
1923
{this.props.author}
2024
</h2>
21-
<span dangerouslySetInnerHTML={{__html: rawMarkup}} />
25+
<span dangerouslySetInnerHTML={this.rawMarkup()} />
2226
</div>
2327
);
2428
}

0 commit comments

Comments
 (0)