mattruby+osn@gmail.com
https://github.com/mattruby/reactSwatchDemo
React.createElement
ReactElement createElement(
string/ReactClass type,
[object props],
[children ...]
)
React.DOM.*
React.createElement('h1', {className:'red'}, 'Hello OSN!');
React.DOM.h1({className:'red'}, 'Hello OSN!');
<h1 class='red'>Hello OSN!</h1>
React.createClass
ReactClass createClass(object specification)
var headerClass = React.createClass({
render: function(){
return React.createElement('h1', {className:'red'}, 'Hello OSN!');
}
});
React.createElement(headerClass, null);
<h1 class='red'>Hello OSN!</h1>
React.render
ReactComponent render(
ReactElement element,
DOMElement container,
[function callback]
)
React.render(
React.createElement(headerClass, null),
document.getElementById('react-container')
);
<div id='react-container'>
<h1 class='red'>Hello OSN!</h1>
</div>
React.createClass
React.render((yourComponent, props), dom node)
mattruby+osn@gmail.com
https://github.com/mattruby/reactSwatchDemo
https://millermedeiros.github.io/js-signals/