A collection of React + useEffect practice projects with real-world APIs. Each mini-project focuses on a specific concept like API fetching, debouncing, pagination, infinite scroll, polling, and device state detection.
Scope:
- Build a stopwatch with Start, Pause, Reset.
- Use useRef to store the timer ID (so it doesn’t reset every render).
- Display elapsed time in HH:MM:SS.
👉 Learn: useRef for intervals & storing values without re-render.
Scope:
- Show a list of numbers (e.g., from API).
- Add a button to sort/filter large data.
- Use useMemo to optimize the expensive calculation (sorting/filtering).
👉 Learn: useMemo to avoid re-calculating on every render.
Scope:
- Parent has a list of todos.
- Each todo is a child component.
- Use React.memo on the todo component so it only re-renders when its own props change.
- Use useCallback to pass stable onDelete and onToggle functions.
👉 Learn: Prevent unnecessary re-renders with useCallback + React.memo.
Scope:
- Build a search input that fetches results from an API (e.g., JSONPlaceholder).
- Use useCallback to debounce the input handler (e.g., only fetch after 500ms pause).
- Pass the search function to a memoized child component.
👉 Learn: Stable function references for performance.
Scope:
- Create an image slider that auto-plays.
- Use useRef to store the interval for auto-play.
- Add Next/Previous buttons without restarting the auto-play.
👉 Learn: useRef for DOM-like behavior & storing mutable values.
Scope:
- Build a form with many fields.
- Use useMemo for derived data (e.g., calculating total cost based on inputs).
- Use useCallback for handlers (onChange, onSubmit) so form fields don’t re-render unnecessarily.
👉 Learn: Optimizing forms with stable functions & cached values.
Scope:
- Display chat messages in a list.
- Wrap each message component with React.memo.
- Only re-render the new message, not the entire list.
👉 Learn: Use React.memo for big lists.
Made with ❤️ by Tanmay Shil GitHub: @TanmayShil