Example: Todo List
This is the complete source code of the tiny todo app we built during the basics tutorial. This code is also in our repository of examples and can be run in your browser via CodeSandbox.
Entry Point
index.js
index.jsimport React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import rootReducer from './reducers'
import App from './components/App'
const store = createStore(rootReducer)
render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
)Action Creators
actions/index.js
actions/index.jsReducers
reducers/todos.js
reducers/todos.jsreducers/visibilityFilter.js
reducers/visibilityFilter.jsreducers/index.js
reducers/index.jsPresentational Components
components/Todo.js
components/Todo.jscomponents/TodoList.js
components/TodoList.jscomponents/Link.js
components/Link.jscomponents/Footer.js
components/Footer.jscomponents/App.js
components/App.jsContainer Components
containers/VisibleTodoList.js
containers/VisibleTodoList.jscontainers/FilterLink.js
containers/FilterLink.jsOther Components
containers/AddTodo.js
containers/AddTodo.jsLast updated