Advertisement
raulghm

U3 Artículo1 SE4

Feb 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. changeStateSection(section) {
  2.     this.setState({ section });
  3.   }
  4.  
  5.   showSections() {
  6.     if (this.state.section === 'todoList') {
  7.       return <TodoList />;
  8.     }
  9.  
  10.     return <AddTodo />;
  11.   }
  12.  
  13.   pickButton() {
  14.     if (this.state.section === 'todoList') {
  15.       return (
  16.         <Button
  17.           onPress={() => { this.changeStateSection('addTodo'); }}
  18.           title="Add Todo"
  19.         />
  20.       );
  21.     }
  22.  
  23.     return (
  24.       <Button
  25.         onPress={() => { this.changeStateSection('todoList'); }}
  26.         title="Cancel"
  27.       />
  28.     );
  29.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement