Welcome to my React learning journey! π
This repository contains my React learning projects and practice work, built while learning React from beginner to advanced concepts. New projects will be added as I continue learning and practicing React.
A reusable React Profile Card component using:
- React Components
- Props
- useState
- CSS Styling
- React
- Vite
- JavaScript (ES6+)
- HTML5
- CSS3
- Git & GitHub
A simple counter application built with React to practice state management.
Features:
- Increase count
- Decrease count
- Increase by 5
- Decrease by 5
- Reset counter
Concepts practiced:
- useState
- Event Handling
- State Updates
- React Components
- React.js
- JavaScript
- HTML5
- CSS3
- Vite
- Git & GitHub
A simple React project created to understand how functional state updates work with useState.
This project demonstrates how to update state based on its previous value using a functional updater.
The example uses an age counter where each button click increases the age by 15.
useStateHook- State and state updater functions
- Functional state updates
- Previous state value
- Event handling with
onClick - React component structure
- JSX
- Re-rendering when state changes
A simple and interactive Todo List application built with React.js as part of my React learning journey.
- Features
- Add new todos
- Edit existing todos
- Update todo items
- Delete todos
- Controlled input field
- Dynamic todo list rendering
- Conditional Add/Update button
- Custom CSS styling
- React Hook Used
- useState
This project uses the React useState hook for state management.
Three state variables are used:
- const [text, setText] = useState("");
- const [todos, setTodos] = useState([]);
- const [editIndex, setEditIndex] = useState(null);
- text β stores the current input value.
- todos β stores the list of todo items.
- editIndex β stores the index of the todo currently being edited.
A simple React practice project built to understand useState, state management, event handling, list rendering, editing, deleting, and maintaining a dynamic item count.
- Features
- Add new items
- Edit existing items
- Update items
- Delete items
- Dynamic item counter
- Controlled input field
- Dynamic list rendering
- Conditional Add/Update button
- Custom CSS styling
- βοΈ React Hook Used
- useState
This project uses React's useState hook to manage multiple pieces of application state.
- const [count, setCount] = useState(0);
- const [text, setText] = useState("");
- const [todos, setTodos] = useState([]);
- const [editIndex, setEditIndex] = useState(null);
A simple React project that changes the background color randomly when the button is clicked.
- Random background color generation
- Displays the current color
- Interactive button
- Dynamic background styling
useState- Event handling with
onClick - Dynamic inline CSS
- JavaScript
Math.random() - Array indexing
- React.js
- JavaScript
- CSS3
- Vite
This project was created to practice React state management, event handling, random values, and dynamic styling using the useState hook.
A simple React project that counts the number of characters typed into a textarea in real time.
- Real-time character counting
- Controlled textarea input
- Clear text button
- Dynamic UI updates
useStateonChangeevent handling- Controlled components
e.target.value.lengthproperty- Dynamic rendering
- React.js
- JavaScript
- CSS3
- Vite
This project was created to practice React state management, controlled inputs, event handling, and dynamic UI updates.
A simple React project that filters a list of fruits based on the user's search query in real time.
- Real-time search filtering
- Case-insensitive search
- Displays matching results
- Shows "No results found" when there are no matches
useState- Controlled input
onChangeevent handlingfilter()map()toLowerCase()includes()- Conditional rendering
- React.js
- JavaScript
- CSS3
- Vite
This project was created to practice React state management, array filtering, controlled inputs, and conditional rendering.
A simple React project that allows users to switch between Dark Mode and Light Mode.
- Toggle between Dark and Light themes
- Displays the current theme
- Dynamic CSS classes
- Interactive theme switch button
useState- Boolean state
onClickevent handling- Conditional rendering
- Dynamic
className - State-based UI updates
- React.js
- JavaScript
- CSS3
- Vite
This project was created to practice React state management, boolean values, conditional rendering, dynamic styling, and event handling.
A simple React project that displays the current time and date and updates the clock every second.
- Real-time digital clock
- Displays current date
- Automatically updates every second
- Clean and simple UI
useStateuseEffectsetInterval()clearInterval()new Date()toLocaleTimeString()toLocaleDateString()- Effect cleanup function
- React.js
- JavaScript
- CSS3
- Vite
This project was created to practice React state management, the useEffect hook, timers, cleanup functions, and working with JavaScript Date objects.
A simple React weather application that fetches real-time weather information for a searched city using the OpenWeatherMap API.
- Search weather by city name
- Displays current temperature
- Shows weather condition and icon
- Displays feels-like temperature
- Shows humidity and wind speed
- Loading and error handling
useState- Controlled input
onChangeevent handlingfetch()- Promises (
then()/catch()) - Conditional rendering
- API data handling
- Dynamic rendering
- React.js
- JavaScript
- CSS3
- OpenWeatherMap API
- Vite
This project was created to practice React state management, API integration, asynchronous data fetching, conditional rendering, error handling, and working with API responses.
This section contains two simple React projects created to the useRef Hook.
A simple React application that automatically focuses on the input field when the component loads. It also allows the user to focus the input by clicking a button.
- Automatically focuses the input on page load
- Focus input using a button
- Uses
useRefto access the DOM element - Uses
useEffectfor initial focus
useRefuseEffect- DOM element reference
inputRef.current.focus()- Event handling
A simple counter example that uses useRef to keep track of how many times a button has been clicked.
Instead of using useState, the click count is stored inside useRef.
- Counts button clicks
- Displays the click count using an alert
- Demonstrates how
useRefcan store a mutable value - Shows that changing
ref.currentdoes not cause a re-render
useRefref.current- Event handling
- Mutable values
- Difference between
useRefanduseState
- React.js
- JavaScript
- CSS3
- Vite
These projects were created to understand how the React useRef Hook works, how it can be used to access DOM elements, and how it can store values without causing a component re-render.
Zeeshan Ahmad Frontend Developer