Skip to content

kyanny/symmetrical-journey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Todo App

This is a simple React todo app that allows you to manage your tasks. It consists of multiple components that work together to provide a seamless user experience.

Project Structure

my-react-todo-app
├── src
│   ├── components
│   │   ├── TodoItem.tsx
│   │   ├── TodoList.tsx
│   │   └── AddTodo.tsx
│   ├── App.tsx
│   └── index.tsx
├── tests
│   ├── TodoItem.test.tsx
│   ├── TodoList.test.tsx
│   └── AddTodo.test.tsx
├── package.json
├── tsconfig.json
├── .babelrc
├── .jest
└── README.md

Components

TodoItem

The TodoItem component represents a single todo item. It has the following props:

  • id (string): The unique identifier of the todo item.
  • text (string): The text content of the todo item.
  • completed (boolean): Indicates whether the todo item is completed or not.
  • onToggle (function): A callback function that is called when the todo item is toggled.

TodoList

The TodoList component represents a list of todo items. It has the following prop:

  • todos (array): An array of todo items.

The TodoList component renders the TodoItem component for each todo item in the array.

AddTodo

The AddTodo component represents a form for adding new todo items. It has the following prop:

  • onAdd (function): A callback function that is called when a new todo item is added.

App

The App component is the entry point of the React application. It renders the TodoList component and the AddTodo component.

index.tsx

The index.tsx file is the entry point of the application. It renders the App component and mounts it to the DOM.

Testing

The project includes unit tests for each component:

  • TodoItem.test.tsx: Contains unit tests for the TodoItem component.
  • TodoList.test.tsx: Contains unit tests for the TodoList component.
  • AddTodo.test.tsx: Contains unit tests for the AddTodo component.

Configuration Files

  • package.json: The configuration file for npm. It lists the dependencies and scripts for the project.
  • tsconfig.json: The configuration file for TypeScript. It specifies the compiler options and the files to include in the compilation.
  • .babelrc: The configuration file for Babel. It specifies the presets and plugins to use for transpiling the code.
  • .jest: The configuration file for Jest. It specifies the testing framework and options for running the unit tests.

Getting Started

To get started with the project, follow these steps:

  1. Clone the repository.
  2. Install the dependencies by running npm install.
  3. Start the development server by running npm start.
  4. Open your browser and navigate to http://localhost:3000.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.

Contact

If you have any questions or need assistance, feel free to contact me at your-email@example.com.


This README file is intentionally left blank.

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published