This file contains 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' | |
import { FormattedMessage } from 'react-intl' | |
import messages from './messages' | |
// it can be a component or a variable | |
const Link = () => ( | |
<a nohref rel="noopener noreferrer"> | |
<FormattedMessage {...messages.reminderLink} /> | |
</a> |
This file contains 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
const myHypotheticalAction = (data) => ({ | |
type: 'MY_HYPOTHETICAL_ACTION', | |
amplitude: { | |
event: { | |
name: 'my-hypothetical-amplitude-event', | |
properties: data, | |
}, | |
identify: true, | |
}, | |
}); |
This file contains 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, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import rickAndMortyApi from './apis/rickAndMorty'; | |
import withApi from './middlewares/withApi'; | |
class App extends PureComponent { | |
handleMorty = () => { | |
const { getMorty } = this.props; | |
getMorty(); |
This file contains 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'; | |
import PropTypes from 'prop-types'; | |
const Filho = (props) => ( | |
<div> | |
<b>Eu sou um componente stateless</b> | |
<span> mas eu controlo o state do meu pai!</span> | |
<input | |
type="text" | |
value={props.valorDoPapaizineo} |
This file contains 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
function getIp() { | |
//inicializo a classe de requisições | |
const xhr = new XMLHttpRequest(); | |
//defino o metodo a ser utilizado (get/post/put/patch/delete) | |
const method = 'GET'; | |
//defino a url que sera utilizada na minah requisição | |
const url = 'https://ipapi.co/json/'; | |
//inicializo a requisição passando o metodo e a url e afirmo que minha requisição sera SINCRONA utilizando o false | |
xhr.open(method, url, false) | |
//executo a requisição configurada acima |