- Reactive Programming: Why It Matters: https://www.youtube.com/watch?v=49dMGC1hM1o
Resume: ...
| const dadosDoTweet = fetch('http://twitelum-api.herokuapp.com/tweets') | |
| console.log(dadosDoTweet) |
| <h1>Gerador de Rodapés da Caelum</h1> | |
| <input type="text" /> | |
| <button class="rodape-alura" data-rodape="rodape-alura">Rodapé Alura</button> | |
| <script> | |
| // # Usuario | |
| // - clica no botao |
Resume: ...
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <h1 id="display"></h1> | |
| <script type="text/javascript"> | |
| (function() { | |
| // Source: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/ |
| const mapStateToProps = (stateDaStore) => { | |
| return { | |
| repos: stateDaStore.repos | |
| } | |
| } | |
| const mapDispatchToProps = (dispatch) => { | |
| return { | |
| carregaRepos: () => { | |
| fetch('https://api.github.com/users/omariosouto/repos').then((response) => response.json()) |
| class MyComponent { | |
| constructor(props) { | |
| super() | |
| const isServer = props.staticContext | |
| if(isServer) { | |
| this.state = { | |
| repos: props.staticContext.repos | |
| } | |
| } else { | |
| this.state = { |
| class MyComponent { | |
| static async getInitialData() { | |
| try { | |
| return { | |
| repos: await fetch('https://api.github.com/users/omariosouto/repos').then((response) => response.json()) | |
| } | |
| } catch(error) { | |
| // Se algum erro acontecer: console.log(error) | |
| return { | |
| repos: [] |
| import React, { Component } from 'react'; | |
| import Helmet from 'react-helmet' | |
| import logo from '../../assets/img/react.svg'; | |
| import './Home.css'; | |
| import NavMenu from '../../components/NavMenu' | |
| class Home extends Component { | |
| static async getInitialData() { | |
| try { |
| .modal { | |
| opacity: 0; | |
| position: fixed; | |
| width: 100%; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: rgba(0,0,0,0.4); | |
| pointer-events: none; |