Skip to content

Commit d8a3a4c

Browse files
author
vvo
committed
fix: no state needed for Hogan component
1 parent ea666ad commit d8a3a4c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

components/templates/Hogan/index.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
'use strict';
22

3-
var React = require('react');
4-
53
var hogan = require('hogan.js');
4+
var React = require('react');
65

76
var HoganResult = React.createClass({
87
propTypes: {
98
template: React.PropTypes.string,
109
data: React.PropTypes.object
1110
},
12-
componentWillMount: function() {
13-
this.setState({
14-
template: hogan.compile(this.props.template)
15-
});
16-
},
1711
render: function() {
18-
var content = this.state.template.render(this.props.data);
12+
var content = hogan.compile(this.props.template).render(this.props.data);
1913
return <div className="hit" dangerouslySetInnerHTML={{__html: content}} />;
2014
}
2115
});

0 commit comments

Comments
 (0)