Answer the question
In order to leave comments, you need to log in
Handlebars + React.js: how to make it work?
Hello.
For practical purposes, I decided to try using handlebars with react, but I just can't get it to work.
For example, how to make this code work? And does it make sense to use react and handlebars on the project?
render: function () {
var data = this.state.previewData;
// ??????????
// Handlebars.compile();
return <div className="row" id="compile">
<script type="text/x-handlebars-template">
{{CompanyName}}
</script>
</div>
}
Answer the question
In order to leave comments, you need to log in
Uh, what are you talking about, React has its own template engine, write code in JSX. You are violating the whole concept of React by using a third-party template engine!
If you really want to write templates on Handlebars, go to Ember.js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question