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, { useEffect } from 'react'; | |
import { Button } from './Button'; | |
function App() { | |
const [total, setTotal] = React.useState(0); | |
return ( | |
<div> | |
<p>Total: {total}</p> | |
<Button increment={setTotal} /> | |
</div> |
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 { Button } from './Button'; | |
import { Input } from './Input'; | |
import { Checkbox } from './Checkbox'; | |
function App() { | |
const [total, setTotal] = React.useState(0) | |
const [data, setData] = React.useState(''); | |
function increment() { |
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' | |
export const Checkbox = ({ label} : {label: string}) => { | |
const [value, setValue] = React.useState(false); | |
return ( | |
<label style={{ | |
padding: "1rem", | |
border: value ? "2px solid #8D2" : "2px solid #F70" | |
}}> | |
<input |
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' | |
export const Checkbox = ({ label} : {label: string}) => { | |
const [value, setValue] = React.useState(false); | |
const handleChange: React.ChangeEventHandler<HTMLInputElement> = (event) => { | |
setValue(event.currentTarget.checked) | |
} | |
return ( | |
<label style={{ | |
padding: "1rem", |
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
validacao = False | |
while (validacao is False): | |
sexo = str(input('Informe o seu sexo, sendo M - Masculino e F- Feminimo: ')) | |
if sexo == 'M' or sexo == 'm' or sexo == 'F' or sexo == 'f': | |
validacao = True | |
else: | |
validacao = False | |
NewerOlder