Skip to content

About

learn react19 from scratch with hands on exercise and code examples , completing the whole concepts follow me to stay updated with the react and tech updates

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

254 Commits

Folders and files

Repository files navigation

React 19 Learning Repository

πŸš€ Learn React 19 from Scratch

A comprehensive, hands-on learning repository with practical examples, beginner projects, TypeScript mastery, and cutting-edge React 19 features

⚠️ Project Status

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!

Table of Contents

About This Project

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

Tech Stack

  • 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

Folder Structure

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

Getting Started

Prerequisites

Before you begin, make sure you have the following installed:

  • Node.js: Version 18.0 or higher
  • npm or yarn: Package managers

Installation

  1. Clone the repository
git clone <your-repository-url>
cd react19-Learning
  1. Install dependencies for the main application
npm install
  1. Install dependencies for the documentation (optional, if you want to run the docs locally)
cd docs
npm install
cd ..

Running the Main Application

To run the React application with all the example components:

npm run dev

The application will open automatically in your browser at http://localhost:5173.

Running the Documentation

To run the documentation site locally:

cd docs
npm start

The documentation site will open at http://localhost:3000.

Learning Path

Follow this step-by-step path to learn React from fundamentals to advanced features:

Phase 1: React Fundamentals

  1. Components β€” Start with the basics of functional React components
  2. JSX β€” Learn JSX syntax, expressions, and formatting rules
  3. Lists β€” Master rendering lists and using keys properly
  4. Props β€” Understand component communication and passing data
  5. Conditional Rendering β€” Explore ternary operators, logical &&, and early returns
  6. Styling in React β€” External CSS, inline styling, and style objects
  7. State and Hooks β€” Manage reactive state with useState (primitives, arrays, and objects)
  8. Portals β€” Render components into separate DOM nodes with React Portals
  9. useEffect β€” Perform side effects, subscriptions, and data fetching
  10. Prop Drilling β€” Understand why passing props deeply becomes problematic
  11. Context API β€” Solve prop drilling with centralized global state
  12. useReducer β€” Handle complex state transitions with reducers and actions
  13. useRef β€” Work with mutable references and direct DOM access
  14. Custom Hooks β€” Extract reusable logic into custom hooks (e.g. useFetch)
  15. useId β€” Generate stable, unique IDs for accessible form inputs

Phase 2: Beginner Projects (Practice Phase)

Practice core React concepts with 10 interactive hands-on projects:

  1. Counter Project β€” State management with increment, decrement, and reset
  2. Todo Project β€” List manipulation, state updates, and item deletion
  3. Meals Project β€” Asynchronous data fetching with API integration
  4. Calculator Project β€” Mathematical parsing with arithmetic input validation
  5. Toggle Background Color β€” Dynamic UI styling and theme toggling
  6. Hidden Search Bar β€” Animated state-driven input visibility
  7. Testimonials Project β€” Carousel navigation with stateful indexes
  8. Accordion Project β€” Collapsible FAQ list using external data files
  9. Form Validation Project β€” Controlled inputs, validation logic, and error handling
  10. Image Gallery Project β€” Media presentation with previous/next controls

Phase 3: React with TypeScript

Equip your React applications with full type safety:

  1. Introduction & Setup β€” TypeScript basics, installation, and .ts/.tsx file conventions
  2. Type Annotations β€” Explicit types for primitives (string, number, boolean)
  3. Type Inference & Any Type β€” Compiler inference rules and best practices for avoiding any
  4. Function Parameters & Return Types β€” Optional parameters, default values, void, and never
  5. Types in TypeScript β€” Typed arrays, multi-dimensional matrices, and object structures
  6. Type Aliases β€” Creating reusable custom types and optional properties (?)
  7. Intersection Types β€” Combining types using the & operator
  8. Union Types, Literals, & Tuples β€” Multi-type alternatives (|), literal values, and fixed-length tuples
  9. Enums β€” Numeric auto-indexing and string-based named constant collections
  10. Classes and OOP β€” Object-oriented patterns, access modifiers (public, private, protected), and constructors
  11. Interfaces β€” Object contracts, function signatures, class implementation (implements), and declaration merging
  12. Generics β€” Reusable type-safe components (<T>), multi-parameter generics (<T, U>), and generic classes
  13. Type Narrowing β€” Refining types with typeof guards, instanceof checks, and intersection patterns

Phase 4: React 19 Features

Explore the latest architectural shifts and APIs in React 19:

  1. React Compiler β€” Automatic memoization removing the need for manual useMemo and useCallback
  2. Metadata & SEO β€” Built-in native document metadata tags (<title>, <meta>) without external packages
  3. Server & Client Directives β€” Seamless separation of concerns with "use client" and "use server"
  4. The use() Hook β€” Read Promises and Context conditionally inside loops and branches
  5. Actions & Async Transitions β€” Simplified form handling with automated pending states
  6. useFormStatus & useActionState β€” Native hooks to manage submission state, form actions, and error handling

Concepts Covered

React Fundamentals

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

Beginner Projects

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

React with TypeScript

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

React 19 Features

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

Contributing

Feel free to contribute to this learning repository! Whether it's fixing bugs, adding new examples, or improving documentation, all contributions are welcome.

Connect with Me

If you find this repository helpful, consider connecting with me on social media! I share updates about web development, React, and more.

Let's Connect! 🌐

Portfolio
LinkedIn
Twitter


Don't forget to ⭐ this repository if you found it helpful!

Happy learning React 19! πŸš€

About

learn react19 from scratch with hands on exercise and code examples , completing the whole concepts follow me to stay updated with the react and tech updates

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages