Skip to content

Instantly share code, notes, and snippets.

@01Clarian
Created Jan 12, 2020
Embed
What would you like to do?
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