Skip to content

Instantly share code, notes, and snippets.

@01Clarian
Created January 12, 2020 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 01Clarian/641e7f9e618e8ae7ffc6acc1bf54f3e8 to your computer and use it in GitHub Desktop.
Save 01Clarian/641e7f9e618e8ae7ffc6acc1bf54f3e8 to your computer and use it in GitHub Desktop.
Parent Application that takes weather component basic data and counter click
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