Created
January 12, 2020 17:24
-
-
Save 01Clarian/641e7f9e618e8ae7ffc6acc1bf54f3e8 to your computer and use it in GitHub Desktop.
Parent Application that takes weather component basic data and counter click
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,{useState} from 'react'; | |
import Weather from './Weather' | |
import './App.css'; | |
function App() { | |
const [counter, setCounter] = useState(0) | |
const [weather] = useState({city:'Miami', temperature:'80F'}) | |
return ( | |
<div className="App"> | |
<Weather weather={weather} /> | |
{counter} | |
<br/> | |
<button onClick={()=>setCounter(counter + 1)}>Increment</button> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment