ReactJS-From_Basic

React Learning Project - 30 Days Web Development Journey

🎯 Current Status: Days 1-35 React Mastery COMPLETED βœ… + Custom Hooks Implementation

πŸ“š Latest Achievement: Custom Hooks ecosystem with form validation, data fetching, and DOM manipulation

πŸ”₯ Complete Features: SPA routing, Context API, ALL React hooks, Custom Hooks, and form validation

πŸš€ Next Phase: Redux integration and performance optimization

This is a comprehensive React learning project created as part of a 30-day web development journey. The project demonstrates various React concepts, hooks, routing, context API, and advanced state management through practical examples.

Project Overview

This project was bootstrapped with Create React App and contains multiple React components showcasing different concepts:

Components Built

  1. Router Example (RouterExample.jsx) - Main Navigation System

    • Implements React Router for SPA navigation
    • Features multiple routes: Home, About, Contact, Login
    • Includes 404 error handling
    • Navigation bar component for seamless routing
  2. Page Components

    • Home Component (Home.jsx) - Landing page with styling
    • About Component (About.jsx) - About page with custom CSS
    • Contact Component (Contact.jsx) - Contact page with styling
    • Login Component (Login.jsx) - User login interface
    • Error Component (Error.jsx) - 404 error page handling
  3. Context API Implementation (A_ContextAPI.jsx, B_ContextAPI.jsx, C_ContextAPI.jsx)

    • Demonstrates React Context for state management
    • Shows data sharing between components without prop drilling
    • Multiple context providers and consumers
  4. Advanced State Management

    • useReducer Tutorial (useReducerTutorial.js) - Complex state logic
    • useReducer Example (useReducerTutorialExample.js) - Practical implementation
    • Multiple Return Component (MultipleReturn.js) - Conditional rendering with API calls
  5. Data Fetching & API Integration

    • Fetch Component (Fetch.js) - API data fetching examples
    • Multiple Return - GitHub API integration with loading states
    • Error handling and loading states
  6. Advanced React Hooks

    • UseEffect Component (UseEffect.js) - Hook demonstrations with side effects
    • UseLayoutEffect Example (Uselayoutexample.js) - useEffect vs useLayoutEffect comparison
    • UseRef Example (UseRef.jsx) - NEW! DOM manipulation and direct element access
    • Incrementor Component (Incrementor.js) - Counter with useState
    • Form Component (From.js) - Form handling and validation
    • Data Component (Data.js) - JSON data rendering
  7. Custom Hooks Implementation πŸ†•

    • useForm Hook (Custonhooks/useForm.js) - NEW! Reusable form logic with validation
    • Form Component (Custonhooks/Form.js) - NEW! Complete form implementation using custom hook
    • Validation Logic (Custonhooks/validate.js) - NEW! Form validation utility
    • useWindowWidth Hook (CustomHook.js) - NEW! Window resize detection custom hook
    • useFetch Hook (CustomHook2.js) - NEW! Data fetching custom hook with loading states

Key React Concepts Covered

Project Structure

src/
β”œβ”€β”€ App.js                      # Main App component
β”œβ”€β”€ index.js                    # Entry point
β”œβ”€β”€ RouterExample.jsx           # Main routing component with navigation
β”œβ”€β”€ navBar.jsx                  # Navigation bar component
β”œβ”€β”€ navBar.css                  # Navigation styling
β”‚
β”œβ”€β”€ Page Components/
β”‚   β”œβ”€β”€ Home.jsx                # Home page component
β”‚   β”œβ”€β”€ Home.css                # Home page styling
β”‚   β”œβ”€β”€ About.jsx               # About page component
β”‚   β”œβ”€β”€ About.css               # About page styling
β”‚   β”œβ”€β”€ Contact.jsx             # Contact page component
β”‚   β”œβ”€β”€ Contact.css             # Contact page styling
β”‚   β”œβ”€β”€ Login.jsx               # Login page component
β”‚   β”œβ”€β”€ Login.css               # Login page styling
β”‚   └── Error.jsx               # 404 error page
β”‚
β”œβ”€β”€ Context API/
β”‚   β”œβ”€β”€ A_ContextAPI.jsx        # Context provider setup
β”‚   β”œβ”€β”€ B_ContextAPI.jsx        # Context consumer component
β”‚   └── C_ContextAPI.jsx        # Additional context component
β”‚
β”œβ”€β”€ State Management/
β”‚   β”œβ”€β”€ useReducerTutorial.js   # useReducer hook tutorial
β”‚   β”œβ”€β”€ useReducerTutorialExample.js # useReducer practical example
β”‚   └── MultipleReturn.js       # Conditional rendering with API
β”‚
β”œβ”€β”€ Data & API/
β”‚   β”œβ”€β”€ Fetch.js                # API fetching examples
β”‚   β”œβ”€β”€ Data.js                 # JSON data rendering
β”‚   └── datas.json              # Sample JSON data
β”‚
└── Basic Components/
    β”œβ”€β”€ UseEffect.js            # useEffect hook demo
    β”œβ”€β”€ Uselayoutexample.js     # useLayoutEffect vs useEffect comparison
    β”œβ”€β”€ UseRef.jsx              # useRef for DOM manipulation
    β”œβ”€β”€ Incrementor.js          # Counter component
    └── From.js                 # Form component

β”œβ”€β”€ Custom Hooks/
β”‚   β”œβ”€β”€ CustomHook.js           # useWindowWidth custom hook
β”‚   β”œβ”€β”€ CustomHook2.js          # useFetch custom hook
β”‚   └── Custonhooks/
β”‚       β”œβ”€β”€ useForm.js          # Form handling custom hook
β”‚       β”œβ”€β”€ Form.js             # Form component using custom hook
β”‚       └── validate.js         # Form validation utility

Current Status

The project has evolved into a comprehensive React application featuring:

πŸš€ Current Main Feature: React Router Implementation

πŸ”₯ Advanced Features Implemented:

πŸ†• Latest Addition: Custom Hooks Implementation

Files: CustomHook.js, CustomHook2.js, Custonhooks/ directory, UseRef.jsx

Custom Hooks Created:

  1. useForm Hook (Custonhooks/useForm.js)

    • Complete form state management
    • Input change handling
    • Form submission with validation
    • Error state management
    • Reusable across multiple forms
  2. useWindowWidth Hook (CustomHook.js)

    • Real-time window width tracking
    • Event listener cleanup
    • Responsive design utility
    • Performance optimized
  3. useFetch Hook (CustomHook2.js)

    • Data fetching abstraction
    • Loading state management
    • Error handling
    • Reusable for any API endpoint
  4. useRef Implementation (UseRef.jsx)

    • Direct DOM manipulation
    • Input focus management
    • Uncontrolled component patterns

Key Learning Points:

πŸ“ Component Highlights:

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

Learning Progress & Timeline

This project demonstrates a structured approach to mastering React development:

Phase 1: Fundamentals (Days 1-7)

Phase 2: Hooks & Effects (Days 8-14)

Phase 3: Advanced React (Days 15-21)

Phase 4: Application Architecture (Days 22-30)

Technical Skills Mastered:

βœ… React Core Concepts

βœ… React Hooks Expertise

βœ… React Router Mastery

βœ… State Management Patterns

βœ… API Integration & Async Programming

βœ… Modern Development Setup

βœ… Project Architecture & Best Practices

Features to Explore

Current Working Features:

  1. Multi-page Navigation - Browse between Home, About, Contact, Login
  2. GitHub API Integration - View GitHub users with loading states
  3. Context API Demo - See global state management in action
  4. Counter with useReducer - Advanced state management patterns
  5. Hook Timing Comparison - useEffect vs useLayoutEffect execution order
  6. Custom Hook Suite - NEW! useForm, useFetch, useWindowWidth demonstrations
  7. Form Validation System - NEW! Complete form handling with custom validation
  8. DOM Manipulation - NEW! useRef for direct element access and focus control
  9. Form Interactions - Input handling and validation
  10. 404 Error Page - Proper error handling for invalid routes

🎯 Current Project Status (Updated September 6, 2025)

βœ… COMPLETED FEATURES

βœ… React Fundamentals

βœ… React Router Implementation

βœ… Advanced React Hooks

βœ… Custom Hooks Implementation NEW!

βœ… Context API Implementation

βœ… Data Handling & API Integration

βœ… Form Handling

βœ… Project Architecture

πŸ”„ WHAT’S WORKING RIGHT NOW

  1. Multi-Page SPA Navigation - Full routing system between all pages
  2. Context API Demo - Global state sharing across components
  3. useEffect Examples - Side effects, cleanup, and dependencies
  4. useLayoutEffect Comparison - Hook execution timing demonstration
  5. useRef DOM Manipulation - NEW! Direct element access and focus control
  6. Custom Hook Suite - NEW! useForm, useFetch, useWindowWidth in action
  7. Form Validation System - NEW! Complete form handling with error states
  8. useReducer Patterns - Complex state management demonstrations
  9. API Integration - Real GitHub API data fetching
  10. Form Interactions - Input handling and state updates
  11. Error Boundaries - 404 page and error handling
  12. Counter Application - useState demonstrations

πŸš€ NEXT DEVELOPMENT PHASE

Phase 5: Advanced Hooks & Performance (Days 31-35) βœ… COMPLETED

Phase 6: Performance Optimization (Days 36-40)

Phase 7: Redux & Advanced State (Days 41-45)

Phase 8: Testing & Production (Days 46-50)

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify