Compile Handlebars templates to React.
Compile this:
into this:
React.DOM.div(null,
"text1",
this.props.variable1,
this.props.variable2 ? React.DOM.span(null,
"text2"
) : "text3",
React.DOM.span({"data-attr":(this.props.variable3 ? "value1" : "") + " value2"},
"text4"
)
);Node.js >= 0.10 is required. Type this at the command line:
npm install handlebars-react --save-devvar HandlebarsReact = require("handlebars-react");
new HandlebarsReact(options)
.compile("<h1>{{title}}</h1>")
.then( function(result) {
console.log("done!");
});Accessible via define() or window.HandlebarsReact.
Type: Boolean
Default value: false
When true, output will be formatted for increased legibility.
Type: String
Default value: undefined
Option presets for your target environment: "development" or "production". Preset options can be overridden.
Type: Boolean
Default value: false
See handlebars-html-parser.
Type: Boolean
Default value: false
See handlebars-html-parser.
Type: Boolean
Default value: false
See handlebars-html-parser.
Type: Boolean
Default value: false
When true, available React.DOM convenience functions will be used instead of React.createElement().
- make dom-style-parser use postcss instead of cssparse?
- support
<template> convertHbsCommentsto JavaScript block comments (or HTML comments?)convertHtmlCommentsto JavaScript block commentsignoreCommentsoption when React supports such (react#2810)trimWhitespaceoption to remove spaces between elements (<tag> a word <tag>to<tag>a word<tag>)?
- 0.0.1–0.0.15 pre-releases