Last active
January 13, 2017 12:13
-
-
Save tuliofaria/517403260a623f69279d8a0c726b4729 to your computer and use it in GitHub Desktop.
Colinha - ReactJS
This file contains hidden or 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
| import React, { Component } from 'react' | |
| import ReactDOM from 'react-dom' | |
| class Componente extends Component { | |
| render(){ | |
| return(<p>Olá devPleno!</p>) | |
| } | |
| } | |
| ReactDOM.render( | |
| <Componente />, | |
| document.getElementById('root') | |
| ) |
This file contains hidden or 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
| import React from 'react'; | |
| const Componente = React.createClass({ | |
| render() { | |
| return(<p>Olá devPleno!</p>) | |
| } | |
| }) | |
| ReactDOM.render( | |
| <Componente />, | |
| document.getElementById('root') | |
| ) |
This file contains hidden or 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
| import React, { Component } from 'react' | |
| import ReactDOM from 'react-dom' | |
| class Componente extends Component { | |
| render(){ | |
| return(<p>Olá {this.props.name}!</p>) | |
| } | |
| } | |
| ReactDOM.render( | |
| <Componente name='devPleno' />, | |
| document.getElementById('root') | |
| ) |
This file contains hidden or 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
| import React, { Component } from 'react' | |
| import ReactDOM from 'react-dom' | |
| class Header extends Component { | |
| render(){ | |
| return(<p>Sistema de pedidos</p>) | |
| } | |
| } | |
| class Footer extends Component { | |
| render(){ | |
| return(<p>desenvolvido por: Tulio Faria - DevPleno</p>) | |
| } | |
| } | |
| class App extends Component { | |
| render(){ | |
| return(<div> | |
| <Header /> | |
| <p>Conteúdo</p> | |
| <Footer /> | |
| </div>) | |
| } | |
| } | |
| ReactDOM.render( | |
| <App />, | |
| document.getElementById('root') | |
| ) |
This file contains hidden or 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
| import React, { Component } from 'react' | |
| class Componente extends Component { | |
| render(){ | |
| return(<p>Olá {this.props.name}!</p>) | |
| } | |
| } | |
| Componente.propTypes = { | |
| name: React.PropTypes.string | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment