Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import TodoList from './components/TodoList'
  3.  
  4. // For things that dont need a state, you can just do this:
  5. // You can create this in another file, then just use exports and imports
  6. // To include it wherever component you would want
  7. const Header = () => {
  8. return (<div><h1> React Sample App </h1></div>)
  9. }
  10.  
  11. const LIST_NAME = 'My Amazing List'
  12.  
  13. class App extends Component {
  14. render() {
  15. return (
  16. <div>
  17. <Header />
  18. {/* Passing a prop with the key listName */}
  19. <TodoList listName={LIST_NAME} />
  20. </div>
  21. );
  22. }
  23. }
  24.  
  25. export default App
Add Comment
Please, Sign In to add comment