halvalla
Version:
Generate React elements with CoffeeScript functions
20 lines (16 loc) • 518 B
text/coffeescript
module.exports.react =
render: (template, args...) ->
element = template(args...)
if typeof element is 'string' then element
else ReactDOM.renderToStaticMarkup(element)
M = require 'Mithril'
module.exports =
render: (template, args...) ->
try
element = template(args...)
if typeof element is 'string' then element
else renderer(element,{ strict: false })
catch badDog
#console.warn 'ungood render', badDog
throw badDog