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

import 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

Reducers

reducers/todos.js

reducers/visibilityFilter.js

reducers/index.js

Presentational Components

components/Todo.js

components/TodoList.js

components/Link.js

components/Footer.js

components/App.js

Container Components

containers/VisibleTodoList.js

containers/FilterLink.js

Other Components

containers/AddTodo.js

Last updated