-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
O que você está construindo? Configuração para o tutorial Visão geral Construindo o tabuleiro Passando dados por meio de adereços Fazendo um componente interativo Ferramentas de desenvolvedor React
- Loading branch information
1 parent
d090170
commit 2c9d4f6
Showing
2 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useState } from "react"; | ||
|
||
const Square = () => { | ||
const [value, setValue] = useState(null) | ||
|
||
function handleClick() { | ||
setValue('X') | ||
} | ||
|
||
return ( | ||
<button className='square' onClick={handleClick}> | ||
{value} | ||
</button> | ||
); | ||
}; | ||
|
||
export default Square; |