π§© Week 12 β React Fundamentals
π― Goal: Understand the fundamentals of React, component-based architecture, and manage state and events.
π Daily Breakdown
β
β Day 1 β What is React? Setup via Vite or CRA
π§ Topics:
- Why React? SPA vs MPA
- React DOM vs Traditional DOM
- Install Node.js + npm
- Create a React app using Vite or Create React App (CRA)
- File structure overview
π Activities:
- Setup development environment
- Run first React app ("Hello React")
- Customize default files
β
β Day 2 β JSX, Functional Components
π§ Topics:
- What is JSX and why it looks like HTML
- JSX rules (only one parent, expressions in {})
- Functional components syntax
- Component naming conventions
π Activities:
- Create Header, Footer, and Content components
- Use them in App.js
- Use props to pass title from App to Header
β
β Day 3 β Props and State
π§ Topics:
- What are props? Data from parent to child
- Reusable components using props
- What is state?
- useState hook for state management
π Activities:
- Create a Counter component using useState
- Update state with button click
- Pass props to reusable Button components
β
β Day 4 β useEffect Hook
π§ Topics:
- What is useEffect?
- useEffect for side-effects like API calls, logging
- Dependency array: \[], \[var], no array
- Cleanup function
π Activities:
- Create a component that logs every render
- useEffect to fetch JSON Placeholder posts
- useEffect with interval or timeout (auto counter)
β
β Day 5 β Conditional Rendering, Lists & Keys
π§ Topics:
- if-else, ternary, && rendering
- Loop through arrays using map()
- Key prop in lists
- Conditional components (show/hide sections)
π Activities:
- Render a post list from JSON array
- Show βNo posts foundβ if array is empty
- Highlight active post using conditional class
β
β Day 6 β Handling Forms
π§ Topics:
- Forms in React vs HTML
- Controlled vs uncontrolled components
- useState to manage input values
- Form submission handling
π Activities:
- Build a feedback/contact form
- Validate inputs (length check)
- Display submitted data on screen
β
β Day 7 β Mini Project: Task Manager App
π― Build a basic Task Manager (To-do List):
π Features:
- Add new task (input + button)
- Mark as completed / delete task
- Show count of total & completed tasks
- Data stored in component state
π Extra:
- Optional: Save tasks to localStorage
- Optional: Filter All / Completed / Pending
β
Would you like to proceed with π§© Week 13 β React Routing + API Integration next?