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
async function conectarComApi() { | |
const conectaApi = await fetch("https://api.thecatapi.com/v1/images/search"); | |
const conectaApiConvertido = await conectaApi.json() | |
console.log(conectaApiConvertido); | |
} | |
conectarComApi(); |
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
img = new SimpleImage( "img/circulo.bmp" ); | |
img.setZoom( 20 ); | |
pixel = img.getPixel( 4, 0 ); | |
pixel.setRed( 255 ); | |
print(img); |
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
<?php | |
$array = ['foo' => 'bar']; | |
echo $array['bar'] ?? 'baz'; |
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 './AnimalCard.css' | |
export default function AnimalCard(props) { | |
const { name } = props; | |
return ( | |
<h2>{name}</h2> | |
); | |
} |
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'; | |
... | |
function App() { | |
return ( | |
<div className="wrapper"> | |
<h1>Animals</h1> | |
{data.map(animal => ( | |
<AnimalCard | |
key={animal.name} | |
name={animal.name} |
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
export default [ | |
{ | |
name: 'Lion', | |
scientificName: 'Panthero leo', | |
size: 140, | |
diet: ['meat'], | |
}, | |
{ | |
name: 'Gorilla', | |
scientificName: 'Gorilla beringei', |
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 { useState, useEffect } from "react"; | |
export default function App() { | |
const [contador, setContador] = useState(0); | |
useEffect(() => { | |
return () => console.log("Aqui é quando o componente será desmontado!"); | |
}, []); | |
return ( |
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 { useState, useEffect } from "react"; | |
export default function App() { | |
const [contador, setContador] = useState(0); | |
useEffect(() => { | |
console.log("executará o useEffect toda a vez que o [contador] mudar"); | |
}, [contador]); | |
return ( |
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 { useState, useEffect } from "react"; | |
export default function App() { | |
const [contador, setContador] = useState(0); | |
useEffect(() => { | |
console.log("executa o useEffect ao renderizar o componente"); | |
}, []); | |
return ( |
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 { useState } from "react"; | |
export default function App() { | |
const [contador, setContador] = useState(0); | |
return ( | |
<div className="App"> | |
<h1>Contador: {contador}</h1> | |
<button onClick={() => setContador(contador + 1)}>+</button> | |
</div> |
NewerOlder