Created
May 6, 2014 13:50
-
-
Save EtienneLem/3c52167b2ccb6e180132 to your computer and use it in GitHub Desktop.
A JavaScript example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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