musreact
Mustache template to react component compiler
Demo
http://lovasoa.github.io/musreact/
How to use
Directly in html
Compile the mustache template on the client.
<!-- The react component will be mounted here -->
Server compiling
Just save the output of parser.parse(mustacheString)
, and serve it as a normal js file.
An simple script could be:
var fs = ;var parse = parse; var jsSource = ; fs;
It reads the template from react-component.mustache
and saves the compiled
react component to react-component.js
. The component will then be accessible through
the global variable MyComponent
.