Created
July 9, 2018 00:44
-
-
Save pratik-chakravorty/8d8b8efc331e0f4d8f94f98ee06fdb35 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 = { | |
counter: 0 | |
}; | |
handleIncrement = () => { | |
this.setState({ | |
counter: this.state.counter + 1 | |
}); | |
}; | |
render() { | |
return ( | |
<Container> | |
<Header as="h1" className="centered"> | |
Shopping List App | |
</Header> | |
<button onClick={this.handleIncrement}>+</button> | |
{this.state.counter} | |
<AddItem /> | |
</Container> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment