Skip to content

nethmalgeesaraux/React-Tutorial

Repository files navigation

React Tutorial

Project: React-Tutorial

Purpose: This repository is a hands-on tutorial project to learn core React concepts by building small, focused examples and a progressive single-page application (SPA). It's designed for beginners who know basic HTML, CSS, and JavaScript (ES6+), and for intermediate developers who want a structured path to strengthen React fundamentals.


What you'll learn

  • React component model (functional components and hooks)
  • JSX and props
  • State management with useState and useReducer
  • Side effects with useEffect
  • Component composition and lifting state
  • Routing with react-router (basic usage)
  • Fetching data and handling async requests
  • Simple form handling and validation
  • Styling approaches (CSS Modules / styled-components / Tailwind basics)
  • Project organization and best practices

Prerequisites

  • Node.js (v14 or later recommended) and npm or yarn
  • Basic knowledge of JavaScript (let/const, arrow functions, promises)
  • Familiarity with the command line

Getting started (local)

  1. Clone the repository:
git clone https://github.com/your-username/react-tutorial.git
cd react-tutorial
  1. Install dependencies:
npm install
# or
yarn install
  1. Start the development server:
npm start
# or
yarn start

The app will open at http://localhost:3000 by default.


Available scripts

  • npm start — run the dev server with hot reloading
  • npm run build — build the production bundle into /build
  • npm test — run tests (if included)
  • npm run lint — run linters (optional)

Project structure (suggested)

react-tutorial/
├─ public/
│  └─ index.html
├─ src/
│  ├─ components/      # Reusable presentational components
│  ├─ pages/           # Route-level pages
│  ├─ hooks/           # Custom hooks for reuse
│  ├─ services/        # API calls and data fetching
│  ├─ styles/          # Global styles, CSS modules
│  ├─ App.jsx
│  └─ index.jsx
├─ .gitignore
├─ package.json
└─ README.md

Tutorial roadmap (example)

  1. Setup & Hello World — Create React app, understand JSX, render tree
  2. Components & Props — Build small components and pass props
  3. State & EventsuseState, event handlers
  4. Lists & Keys — Render dynamic lists from arrays
  5. Effects & Data FetchinguseEffect, fetch API, loading/error states
  6. Forms — Controlled inputs and form submission
  7. Routingreact-router basics: routes, Link, useParams
  8. Custom Hooks — Extract logic to custom hooks
  9. State Management Patterns — Lifting state, useReducer
  10. Styling — CSS modules or utility-first approach
  11. Build & Deploy — Prepare production build and deploy (Netlify/Vercel)

Example exercises

  • Build a todo list with add/edit/delete and localStorage persistence
  • Create a simple blog that fetches posts from a public API
  • Implement a user search with debounce and suggestions
  • Small CRUD app with client-side state only

Recommended resources


Contributing

Contributions are welcome. Create an issue for suggested exercises or improvements, then open a pull request with a clear description of the changes.


If you'd like, I can tailor this README to a specific starter (Create React App / Vite) or add badges, CI instructions, and deployment steps.

About

TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published