Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react'
- import TodoList from './components/TodoList'
- // For things that dont need a state, you can just do this:
- // You can create this in another file, then just use exports and imports
- // To include it wherever component you would want
- const Header = () => {
- return (<div><h1> React Sample App </h1></div>)
- }
- const LIST_NAME = 'My Amazing List'
- class App extends Component {
- render() {
- return (
- <div>
- <Header />
- {/* Passing a prop with the key listName */}
- <TodoList listName={LIST_NAME} />
- </div>
- );
- }
- }
- export default App
Add Comment
Please, Sign In to add comment