Created
August 4, 2018 20:15
-
-
Save pratik-chakravorty/470d0f668e6a3745eb87c4d513a573c2 to your computer and use it in GitHub Desktop.
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, { Component } from "react"; | |
import { Container, Header } from "semantic-ui-react"; | |
import AddItem from "./AddItem"; | |
class App extends Component { | |
state = { | |
items: [], | |
item: "", | |
amount: "" | |
}; | |
handleChange = e => { | |
this.setState({ | |
[e.target.name]: e.target.value | |
}); | |
}; | |
render() { | |
return ( | |
<Container> | |
<Header as="h1" className="centered"> | |
Shopping List App | |
</Header> | |
<AddItem | |
item={this.state.item} | |
amount={this.state.amount} | |
handleChange={this.handleChange} | |
/> | |
</Container> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment