2 ms·
In CoffeeScript you can use backticks and still use JSX. Example: `/** @jsx React.DOM */` Todo = React.createClass render: -> ` <
by rubiquity 13y ago
In CoffeeScript you can use backticks and still use JSX. Example:
`/** @jsx React.DOM */`
Todo = React.createClass
render: ->
`
<div>
<h3>TODO</h3>
<TodoList items={this.state.items} />
<form onSubmit={this.handleSubmit}>
<input onChange={this.onChange} value={this.state.text} />
<button>{'Add #' + (this.state.items.length + 1)}</button>
</form>
</div>
`
Just remember when compiling the CoffeeScript files to pass the bare, and --no-header flags.
coffee -bc --no-header todo.coffee