Answer the question
In order to leave comments, you need to log in
How to render Handlebars template in React.js in iFrame tag?
Hello, I'm getting an .hd template from the server and I want to parse it, then add it to an iFrame and render it in React. Here is the code:
getTemplate: function () {
var template = Handlebars.compile(this.props.previewHtml.html),
html = template(this.props.previewContext),
iFrame = 'data:text/html,<html><body">' + html + '';
return <iframe src={iFrame } />;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question