■ HTML/JSP
JS Bin
■ JS (ES6/Babel)
class Codelab extends React.Component{ render() { return (); } } Codelab.propTypes = { name: React.PropTypes.string, number: React.PropTypes.number.isRequired }; Codelab.defaultProps = { name: 'Unknown', number: 5 }; class App extends React.Component { render() { return (Hello {this.props.name}
{this.props.number}
{this.props.children}{this.props.children} ); } } ReactDOM.render(I am React.js , document.getElementById('root'));
'Developer > React.js' 카테고리의 다른 글
[Tutorial] State (0) | 2018.01.22 |
---|---|
[Tutorial] JSX (0) | 2018.01.22 |