Skip to content

Instantly share code, notes, and snippets.

@pratik-chakravorty
Created August 4, 2018 20:15
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 pratik-chakravorty/470d0f668e6a3745eb87c4d513a573c2 to your computer and use it in GitHub Desktop.
Save pratik-chakravorty/470d0f668e6a3745eb87c4d513a573c2 to your computer and use it in GitHub Desktop.
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