A comprehensive, hands-on learning repository with practical examples, beginner projects, TypeScript mastery, and cutting-edge React 19 features
This repository is currently in active development! π§
New concepts, examples, and deep dives are being added regularly. Make sure to star β this repository to keep track of updates and follow along with the learning journey!
- About This Project
- Tech Stack
- Folder Structure
- Getting Started
- Learning Path
- Concepts Covered
- Contributing
- Connect with Me
This repository is designed to help you learn React 19 effectively by combining:
- Hands-on code examples: Real, working React components in the main application
- Practical projects: 10 interactive beginner projects applying key concepts
- TypeScript mastery: Thorough TypeScript guides from basic annotations to Generics, Interfaces, and Type Narrowing
- React 19 features: Modern architecture including the React Compiler,
use()hook, Actions, directives, and metadata - Detailed documentation: A Docusaurus-powered documentation site with explanations for each concept
- Progressive learning: Concepts are organized in a logical, beginner-to-advanced order
-
Main Application:
- React 19.1.0
- Vite 6.4.5 (build tool & dev server)
- React Icons 5.5.0
- TypeScript 5.9.2
-
Documentation:
- Docusaurus 3.10.1 (with secured dependency overrides)
- React 19.0.0
- MDX for interactive documentation
react19-Learning/
βββ src/ # Main React application source code
β βββ 01-Fundamentals/ # React fundamentals examples (concepts 1-15)
β β βββ 01.components/ # Basic React components (Header, Footer, Greet, MainContent)
β β βββ 02.jsx/ # JSX syntax, expressions, and rules
β β βββ 03.lists/ # Rendering lists and keys in React
β β βββ 04.props/ # Props and component communication
β β βββ 05.conditionalRendering/ # Conditional rendering techniques
β β βββ 06.stylingInReact/ # Various styling approaches (inline, CSS, objects)
β β βββ 07.StateAndHooks/ # State management with useState (arrays, objects, etc.)
β β βββ 08.portals/ # React Portals (modals, popups)
β β βββ 09.useEffect/ # Side effects with useEffect & data fetching
β β βββ 10.propDrilling/ # Prop drilling concept (A β B β C)
β β βββ 11.ContextAPI/ # Context API for global state management
β β βββ 12.useReducer/ # useReducer hook with separate reducer files
β β βββ 13.useRef/ # useRef hook (DOM references, mutable timers)
β β βββ 14.CustomHook/ # Custom hooks (reusable useFetch hook)
β β βββ 15.useId/ # useId hook for generating unique accessible IDs
β β βββ DocumentationLink.jsx # Reusable documentation link component
β βββ 02-BeginnerProjects/ # Beginner projects to practice concepts
β β βββ 001-CounterProject/ # Interactive counter application
β β βββ 002-TodoProject/ # Full-featured Todo application
β β βββ 003-Mealsproject/ # Meals recipe app with API integration
β β βββ 004-CalculatorProject/# Secure calculator application
β β βββ 005-ToggleBackgroundColorProject/ # Theme & background color switcher
β β βββ 006-HiddenSearchBarProject/ # Expandable hidden search bar
β β βββ 007-TestimonialsProject/ # Testimonials slider carousel
β β βββ 008-AccordionProject/ # Accordion FAQ with dynamic data file
β β βββ 009-FormValidationProject/ # Form validation with real-time feedback
β β βββ 010-ImageGalleryProject/ # Image gallery with navigation controls
β β βββ Index.jsx # Reusable project card wrapper
β β βββ 01-BeginnerProjects.mdx # Beginner projects documentation & guide
β βββ 03-ReactWithTypeScript/ # React + TypeScript comprehensive guides
β β βββ 001-Annotations/ # Type annotations (string, number, boolean)
β β βββ 002-TypeInference/ # Type inference & any type caveats
β β βββ 003-FunctionParametersAnnotations/ # Function params, default values, return types, void, never
β β βββ 004-TypesInTypescript/# Array types, multi-dimensional arrays, object types
β β βββ 005-TypeAliases/ # Type aliases (type keyword) & optional properties (?)
β β βββ 006-IntersectionTypes/# Intersection types (& operator)
β β βββ 007-UnionsTypes/ # Union types (|), literal types, and tuples
β β βββ 008-EnumsTypes/ # Enums β numeric & string named constants
β β βββ 009-ClassAndOOP-InTypescript/ # Classes, constructors, access modifiers (public/private/protected)
β β βββ 010-Interface/ # Interfaces for objects, functions, classes (implements), & declaration merging
β β βββ 011-Generics/ # Generics: <T>, multiple params <T, U>, generic functions, classes, and filters
β β βββ 012-TypeNarrowing/ # Type narrowing: typeof type guards, instanceof, and intersection patterns
β β βββ ReactWithTypeScript.mdx # React + TypeScript setup, configuration, and overview
β βββ 04-React19Features/ # Modern React 19 architecture & new APIs
β β βββ 001-useHook/ # The use() hook for Promises and Context in loops/conditionals
β β βββ 002-Actions/ # React 19 Actions for form submissions and async transitions
β β βββ React19Features.mdx # React 19 overview (Compiler, directives, metadata, obsolete hooks)
β βββ docsMap.js # Section β documentation URL mapping config
β βββ App.jsx # Root application component with categorized sections
β βββ main.jsx # Application entry point
β βββ index.css # Global styling, dark theme, and responsive design
βββ docs/ # Documentation site (Docusaurus)
β βββ docs/ # Documentation content (MDX files)
β β βββ 01.components/ # Components documentation
β β βββ 02.jsx/ # JSX documentation
β β βββ 03.lists/ # Lists documentation
β β βββ 04.props/ # Props documentation
β β βββ 05.conditionalRendering/ # Conditional rendering documentation
β β βββ 06.stylingInReact/ # Styling documentation
β β βββ 07.StateAndHooks/ # State & Hooks documentation
β β βββ 08.Portal/ # React Portals documentation
β β βββ 09.useEffect/ # useEffect documentation
β β βββ 10.propDrilling/ # Prop drilling documentation
β β βββ 11.ContextAPI/ # Context API documentation
β β βββ 12.useReducerhook/ # useReducer documentation
β β βββ 13.useRef/ # useRef documentation
β β βββ 14.customHooks/ # Custom hooks documentation
β β βββ 15.useId/ # useId documentation
β β βββ tutorial-basics/ # Docusaurus tutorial basics
β β βββ tutorial-extras/ # Docusaurus tutorial extras
β β βββ intro.md # Introduction page
β βββ src/ # Docusaurus source code
β βββ static/ # Static assets for docs
β βββ blog/ # Blog posts (Docusaurus blog feature)
β βββ docusaurus.config.js # Docusaurus configuration
β βββ sidebars.js # Sidebar navigation config
β βββ README.md # Docs site README
β βββ package.json # Docs dependencies & overrides
βββ public/ # Static public assets
βββ index.html # Main HTML entry file
βββ vite.config.js # Vite configuration
βββ eslint.config.js # ESLint configuration
βββ package.json # Main project dependencies
βββ package-lock.json # Main project lockfile
βββ docs-link-guide.md # Guide for linking sections to documentation
βββ skill.md # UI/UX design specifications & conventions
βββ README.md # Main project README
Before you begin, make sure you have the following installed:
- Node.js: Version 18.0 or higher
- npm or yarn: Package managers
- Clone the repository
git clone <your-repository-url>
cd react19-Learning- Install dependencies for the main application
npm install- Install dependencies for the documentation (optional, if you want to run the docs locally)
cd docs
npm install
cd ..To run the React application with all the example components:
npm run devThe application will open automatically in your browser at http://localhost:5173.
To run the documentation site locally:
cd docs
npm startThe documentation site will open at http://localhost:3000.
Follow this step-by-step path to learn React from fundamentals to advanced features:
- Components β Start with the basics of functional React components
- JSX β Learn JSX syntax, expressions, and formatting rules
- Lists β Master rendering lists and using keys properly
- Props β Understand component communication and passing data
- Conditional Rendering β Explore ternary operators, logical
&&, and early returns - Styling in React β External CSS, inline styling, and style objects
- State and Hooks β Manage reactive state with
useState(primitives, arrays, and objects) - Portals β Render components into separate DOM nodes with React Portals
- useEffect β Perform side effects, subscriptions, and data fetching
- Prop Drilling β Understand why passing props deeply becomes problematic
- Context API β Solve prop drilling with centralized global state
- useReducer β Handle complex state transitions with reducers and actions
- useRef β Work with mutable references and direct DOM access
- Custom Hooks β Extract reusable logic into custom hooks (e.g.
useFetch) - useId β Generate stable, unique IDs for accessible form inputs
Practice core React concepts with 10 interactive hands-on projects:
- Counter Project β State management with increment, decrement, and reset
- Todo Project β List manipulation, state updates, and item deletion
- Meals Project β Asynchronous data fetching with API integration
- Calculator Project β Mathematical parsing with arithmetic input validation
- Toggle Background Color β Dynamic UI styling and theme toggling
- Hidden Search Bar β Animated state-driven input visibility
- Testimonials Project β Carousel navigation with stateful indexes
- Accordion Project β Collapsible FAQ list using external data files
- Form Validation Project β Controlled inputs, validation logic, and error handling
- Image Gallery Project β Media presentation with previous/next controls
Equip your React applications with full type safety:
- Introduction & Setup β TypeScript basics, installation, and
.ts/.tsxfile conventions - Type Annotations β Explicit types for primitives (
string,number,boolean) - Type Inference & Any Type β Compiler inference rules and best practices for avoiding
any - Function Parameters & Return Types β Optional parameters, default values,
void, andnever - Types in TypeScript β Typed arrays, multi-dimensional matrices, and object structures
- Type Aliases β Creating reusable custom types and optional properties (
?) - Intersection Types β Combining types using the
&operator - Union Types, Literals, & Tuples β Multi-type alternatives (
|), literal values, and fixed-length tuples - Enums β Numeric auto-indexing and string-based named constant collections
- Classes and OOP β Object-oriented patterns, access modifiers (
public,private,protected), and constructors - Interfaces β Object contracts, function signatures, class implementation (
implements), and declaration merging - Generics β Reusable type-safe components (
<T>), multi-parameter generics (<T, U>), and generic classes - Type Narrowing β Refining types with
typeofguards,instanceofchecks, and intersection patterns
Explore the latest architectural shifts and APIs in React 19:
- React Compiler β Automatic memoization removing the need for manual
useMemoanduseCallback - Metadata & SEO β Built-in native document metadata tags (
<title>,<meta>) without external packages - Server & Client Directives β Seamless separation of concerns with
"use client"and"use server" - The
use()Hook β Read Promises and Context conditionally inside loops and branches - Actions & Async Transitions β Simplified form handling with automated pending states
useFormStatus&useActionStateβ Native hooks to manage submission state, form actions, and error handling
Each concept includes working code examples in src/01-Fundamentals/ and explanations in docs/docs/:
| # | Topic | Code Examples | Documentation |
|---|---|---|---|
| 01 | Components | 01.components | components.mdx |
| 02 | JSX | 02.jsx | jsx.mdx |
| 03 | Lists | 03.lists | lists.mdx |
| 04 | Props | 04.props | props.mdx |
| 05 | Conditional Rendering | 05.conditionalRendering | conditionalRendering.mdx |
| 06 | Styling in React | 06.stylingInReact | stylingInReact.mdx |
| 07 | State and Hooks (useState) | 07.StateAndHooks | stateAndHooks.mdx |
| 08 | Portals | 08.portals | Portal.mdx |
| 09 | useEffect | 09.useEffect | useEffect.mdx |
| 10 | Prop Drilling | 10.propDrilling | propDrilling.mdx |
| 11 | Context API | 11.ContextAPI | contextAPI.mdx |
| 12 | useReducer | 12.useReducer | useReducer.mdx |
| 13 | useRef | 13.useRef | useRef.mdx |
| 14 | Custom Hooks | 14.CustomHook | customHooks.mdx |
| 15 | useId | 15.useId | useId.mdx |
All projects live in src/02-BeginnerProjects/ and utilize the reusable BeginnerProjectsWrapper component:
| # | Project | Component File | Description |
|---|---|---|---|
| 001 | Counter Project | Counter.jsx | Interactive counter using useState with increment/decrement/reset |
| 002 | Todo Project | Todo.jsx | Task tracker supporting dynamic addition and item deletion |
| 003 | Meals Project | Meals.jsx | Recipe catalog fetching external meal data via Axios |
| 004 | Calculator Project | Calculator.jsx | Arithmetic calculator with safe input parsing and error handling |
| 005 | Toggle Background Color | ToggleBackgroundColor.jsx | Live background and color scheme switcher |
| 006 | Hidden Search Bar | HiddenSearchBar.jsx | Smooth animated expandable search input |
| 007 | Testimonials | Testimonials.jsx | Client feedback carousel with state-driven slide navigation |
| 008 | Accordion | Accordion.jsx | Expandable FAQ accordion powered by dynamic data structures |
| 009 | Form Validation | FormValidation.jsx | Comprehensive form field validation with visual error indicators |
| 010 | Image Gallery | ImageGallery.jsx | Responsive image viewer with sequential pagination controls |
Full guide: 01-BeginnerProjects.mdx
All TypeScript learning content is organized in src/03-ReactWithTypeScript/:
| # | Topic | File | What You'll Learn |
|---|---|---|---|
| 000 | Introduction & Setup | ReactWithTypeScript.mdx | Overview of TypeScript, setup, benefits in React development, and file conventions (.ts/.tsx) |
| 001 | Type Annotations | Annotations.mdx | Primitive type annotations for variables: string, number, and boolean syntax |
| 002 | Type Inference & Any Type | TypeInference.mdx | Automatic type inference, the any escape hatch, and why overusing any undermines type safety |
| 003 | Function Parameters & Return Types | FunctionParametersAnnotations | Annotating function parameters, default values, return types, and using void and never |
| 004 | Types in TypeScript β Arrays & Objects | TypesInTypescript.mdx | Single & multi-dimensional array types (T[] vs Array<T>), object type shapes, and return factories |
| 005 | Type Aliases & Optional Properties | TypeAliases.mdx | Creating custom reusable types with the type keyword and marking non-required fields with ? |
| 006 | Intersection Types | IntersectionType.mdx | Merging multiple type definitions into unified contracts with the & operator |
| 007 | Union Types, Literals, & Tuples | UnionsType.mdx | Flexible types with ` |
| 008 | Enums β Named Constants | EnumsTypes.mdx | Named constant collections, numeric auto-incrementing enums, and string-valued enums |
| 009 | Classes & OOP in TypeScript | ClassAndOOP-InTypescript.mdx | Class property annotations, access modifiers (public, private, protected), constructors, and OOP |
| 010 | Interfaces | Interface.mdx | Defining object shapes, function interfaces, class contracts via implements, and declaration merging |
| 011 | Generics | Generic.mdx | Writing reusable code with type parameters (<T>), multiple parameters (<T, U>), and generic classes |
| 012 | Type Narrowing | TypeNarrowing.mdx | Refining types conditionally with typeof type guards, instanceof class checks, and intersections |
Modern React 19 documentation and deep dives are located in src/04-React19Features/:
| # | Topic | File | What You'll Learn |
|---|---|---|---|
| 000 | React 19 Architecture Overview | React19Features.mdx | The React Compiler, automatic memoization replacing useMemo/useCallback, native metadata, server/client directives, and obsolete patterns |
| 001 | The use() Hook |
useHookTopic.mdx | Reading Promises and Context asynchronously, conditional usage in loops/branches, and replacing boilerplate useEffect data fetching |
| 002 | React 19 Actions | ActionsTopic.mdx | Form handling with asynchronous actions, pending states, error handling, useActionState, and useFormStatus |
Feel free to contribute to this learning repository! Whether it's fixing bugs, adding new examples, or improving documentation, all contributions are welcome.
If you find this repository helpful, consider connecting with me on social media! I share updates about web development, React, and more.
Don't forget to β this repository if you found it helpful!
Happy learning React 19! π