We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea666ad commit d8a3a4cCopy full SHA for d8a3a4c
components/templates/Hogan/index.js
@@ -1,21 +1,15 @@
1
'use strict';
2
3
-var React = require('react');
4
-
5
var hogan = require('hogan.js');
+var React = require('react');
6
7
var HoganResult = React.createClass({
8
propTypes: {
9
template: React.PropTypes.string,
10
data: React.PropTypes.object
11
},
12
- componentWillMount: function() {
13
- this.setState({
14
- template: hogan.compile(this.props.template)
15
- });
16
- },
17
render: function() {
18
- var content = this.state.template.render(this.props.data);
+ var content = hogan.compile(this.props.template).render(this.props.data);
19
return <div className="hit" dangerouslySetInnerHTML={{__html: content}} />;
20
}
21
});
0 commit comments