Skip to content

Instantly share code, notes, and snippets.

@EtienneLem
Created May 6, 2014 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EtienneLem/3c52167b2ccb6e180132 to your computer and use it in GitHub Desktop.
Save EtienneLem/3c52167b2ccb6e180132 to your computer and use it in GitHub Desktop.
A JavaScript example
Hello = React.createClass({
componentWillMount: function() { console.log('componentWillMount') },
componentDidMount: function() { console.log('componentDidMount') },
render: function() {
return DOM.div({ class: 'container' }, [
DOM.span({
data: {
foo: { bar: 'baz' },
much: { much: 'fun' },
},
class: 'test'
}, 'Hello ' + this.props.name),
DOM.span(', goodbye.')
])
}
})
React.renderComponentToString(Hello({ name: 'World' }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment