This was mostly taken from this boilerplate.
How can I avoid having to write out all the HTML elements I need in every file? Can I add some kind of constructor hook on React.createClass
so that it loads all these as properties? Now that I think about it, though, I'm not sure if I want that. There are a lot of HTML elements, and that would make for a lot of reserved words if I use all those as attributes. It would probably be better to namespace it, but if at all possible I would like to keep this terse syntax.
React = require("react")
Link = require("react-nested-router").Link
{ div, h1, ul, li } = React.DOM
Layout = module.exports = React.createClass
displayName: "Layout"
render: ->
div className: "container",
h1 null, "Layout"
ul null,
li null,
Link to: "index",
"Hoaame"
li null,
Link to: "about",
"about"
@props.activeRoute