A simple React Todo List application designed for learning React fundamentals. This project is built with Create React App and includes comprehensive testing examples and component-based architecture demonstrations.
- React Hooks (useState)
- Component-based Architecture
- Styled Components for styling
- Complete test coverage (Jest + Enzyme + React Testing Library)
- Progressive learning examples
- Node.js >= 14
- Yarn or npm
cd app
yarn installcd app
yarn startOpen your browser and visit http://localhost:3000
cd app
yarn testcd app
yarn buildreact-todo-list/
├── app/ # Main application directory
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── Control.js # Input control component
│ │ │ └── Content.js # Todo list content component
│ │ ├── config/ # Configuration files
│ │ ├── __test__/ # Test files
│ │ ├── App.js # Main application component
│ │ ├── App.todo.basic.js # Basic example (no component split)
│ │ ├── Style.css.js # Styled Components styles
│ │ └── index.js # Application entry point
│ └── package.json
├── docs/ # Tutorial documentation
└── README.md # This file
This project provides two versions of code for learning:
- Basic Version (
App.todo.basic.js): All logic in a single file, suitable for beginners to understand basic concepts - Advanced Version (
App.js+ components): Code split into multiple components, demonstrating React best practices
- Read docs/01-Fundamentals.md to understand React basics
- Study
App.todo.basic.jsto understand the complete flow - Read docs/02-Component-Design.md to learn component splitting
- Study the refactored
App.jsand components directory - Read docs/03-Styling.md to learn Styled Components
- Read docs/04-Testing.md to learn how to write tests
- Add todo items
- Click on todo items to remove them
- Use timestamp as unique ID
- React 16.14.0
- Styled Components 5.2.3
- Jest + Enzyme + React Testing Library
- Create React App 4.0.3
Complete tutorial documentation can be found in the docs directory:
- 01-Fundamentals.md - React basics and Hooks introduction
- 02-Component-Design.md - Component splitting and best practices
- 03-Styling.md - Styled Components usage guide
- 04-Testing.md - Writing and running tests
- 05-FAQ.md - Frequently Asked Questions and troubleshooting
MIT License - See LICENSE file for details
Issues and Pull Requests are welcome!
Sean Chou