To create a ReactComponent
:
ReactComponent React.createClass(object proto)
Basic JSX example:
var TitleComponent = React.createClass({
// REQUIRED
render: function() {
return (<h1>Hello { this.props.name }</h1>);
}
});
React.renderComponent(<TitleComponent name="John" />, mountNode);
Compiles to:
var TitleComponent = React.createClass({
displayName: 'TitleComponent`,
render: function() {
return React.DOM.h1(null, "Hello ", this.props.name);
}
});
React.renderComponent(TitleComponent( {name:"John"} ), mountNode);
DOMElement getDOMNode()
#setProps(object nextProps)
#replaceProps(object nextProps)
#ReactComponent transferPropsTo(ReactComponent targetComponent)
#setState(object nextState[, function callback])
#replaceState(object nextState[, function callback])
#forceUpdate([function callback])
#bool isMounted()
#