Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- changeStateSection(section) {
- this.setState({ section });
- }
- showSections() {
- if (this.state.section === 'todoList') {
- return <TodoList />;
- }
- return <AddTodo />;
- }
- pickButton() {
- if (this.state.section === 'todoList') {
- return (
- <Button
- onPress={() => { this.changeStateSection('addTodo'); }}
- title="Add Todo"
- />
- );
- }
- return (
- <Button
- onPress={() => { this.changeStateSection('todoList'); }}
- title="Cancel"
- />
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement