diff --git a/public/favicon.ico b/public/favicon.ico index a11777c..0ad48d7 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/logo192.png b/public/logo192.png index fc44b0a..fce04a7 100644 Binary files a/public/logo192.png and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png index a4e47a6..ab3e3ac 100644 Binary files a/public/logo512.png and b/public/logo512.png differ diff --git a/src/App.js b/src/App.js index e07a942..2b15309 100644 --- a/src/App.js +++ b/src/App.js @@ -1,6 +1,6 @@ -import './App.css'; +import "./App.css"; -function App({name}) { +function App({ name }) { return (

Hello,{name}

diff --git a/src/index.js b/src/index.js index deb1918..7c398af 100644 --- a/src/index.js +++ b/src/index.js @@ -1,30 +1,26 @@ -import React, {useState} from 'react'; //useState is a function, this is why i use { } -import ReactDOM from 'react-dom'; -import './index.css'; +import React, { useState } from "react"; //useState is a function, this is why i use { } +import ReactDOM from "react-dom"; +import "./index.css"; function App() { - //state function -const [status, setStatus] = useState("open");//a function to change the state - -//state variable -/* const [status] = useState("open") //the current state -console.log(status) // open */ - -//what is useState? -/* const result = useState; -console.log(result) // a array with 2 itens - 0:undefined 1:()=> - a fuction */ + const [check, setCheck] = useState(false); return ( - <> -

the door is:{status}

- - +
+ { + setCheck((check) => !check); + }} + /> +

{check ? "checked" : "no checked"}

+
); } ReactDOM.render( - + , - document.getElementById('root') + document.getElementById("root") ); -