Skip to content

Commit

Permalink
changes 03/07 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleph Goldstein committed Jul 3, 2024
1 parent c450212 commit 779aacc
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import MostraNome from "./components/MostraNome"
import { useState } from "react";
/*
import MostraNome from "./components/MostraNome"
function App() {
const [pessoa, setPessoa] = useState("Professor de TI")
function handleChangeName(nome){
Expand All @@ -25,4 +26,26 @@ function App() {
}
export default App;

*/
function MeuForms(){
const[nome,setNome] = useState(" ");
const handleChange = (event) => {
setNome(event.target.value)
};
const handleSubmit = (event) => {
event.preventDefault();
alert(`Olá ${nome}`)
}
return(
<div>
<form onSubmit={handleSubmit}>
<label>
Nome:
<input type="text" value={nome} onChange={handleChange} />
</label>
<input type="submit" value="Enviar" />
</form>
</div>
)
}
export default MeuForms;

0 comments on commit 779aacc

Please sign in to comment.