An open API service indexing awesome lists of open source software.

https://github.com/espadv69/usecontext-basics

useContext-Basics is a collection of three simple React projects that demonstrate how to use the useContext hook for global state management. Each mini-project focuses on a different real-world scenario: theme toggling, user authentication, and language selection.
https://github.com/espadv69/usecontext-basics

authentication dark-theme hooks idioms javascript languages light-theme provider react states switch usecontext useeffect users vite

Last synced: 6 months ago
JSON representation

useContext-Basics is a collection of three simple React projects that demonstrate how to use the useContext hook for global state management. Each mini-project focuses on a different real-world scenario: theme toggling, user authentication, and language selection.

Awesome Lists containing this project

README

          

# useContext-Basics

**useContext-Basics** is a collection of three simple React projects that demonstrate how to use the `useContext` hook for global state management. Each mini-project focuses on a different real-world scenario: theme toggling, user authentication, and language selection.

## 📁 Projects

1. **ThemeToggle-Context**
Toggle between light and dark mode using `ThemeContext`.

2. **AuthContextDemo-Context**
Simulated login/logout functionality with `AuthContext`.

3. **LanguageSelector-Context**
Switch between different languages using `LanguageContext`.

## 🚀 Getting Started

Each project is located in its own folder. You can run them individually:

```bash
cd ProjectFolderName
npm install
npm run dev
```

#### Example:

```bash
cd ThemeToggle-Context
npm install
npm run dev
```

## 🛠️ Requirements

- Node.js and npm installed
- Basic knowledge of React

## 📚 Topics Covered

- Creating and using context providers
- Sharing state across components
- Managing themes, auth state, and language preferences globally

## 🤝 Contributing

Feel free to submit issues or pull requests to improve this project.

## 📄 License

This project is licensed under the **[MIT License](https://opensource.org/license/mit)**.

---

Made with ❤️ by Espadv69