React Task - Architecture & Custom Hooks

  • You will refactor and build a small React application using clean architecture patterns and reusable custom hooks.

πŸ›  Project Setup

  • clone the project

git clone https://github.com/ITC-Frontend-Advanced/React-Task-Architecture-Custom-Hooks.git
  • Checkout the Refactor Branch

git checkout app

# Analyze the existing codebase before making changes.
  • Refactor to Feature-Based Architecture

πŸ“ Repository Structure

The repository contains two branches:

  • main: Contains this task description and instructions.

  • app: Contains an existing React application with

    • Mixed responsibilities

    • Centralized logic

    • Poor or flat structure

Your job is to refactor the app, not rewrite it.

πŸ“Œ Objective

This task focuses on refactoring an existing React application to demonstrate a strong understanding of:

  • Feature-based architecture

  • Custom hook design and reuse

You will not create a new app from scratch.

Feature-based architecture

You must reorganize the project into a feature-based structure.

Extract Custom Hooks

You must extract at least two custom hooks from the existing code.

Required:

  1. Data-related hook

    1. Handles fetching, loading, and error state

    2. Cleanup where necessary

  2. Logic-related hook

    1. Examples:

      1. useCanvas

      2. useFetch

      3. useMobile

πŸ“€ Deliverables

Your submission must include:

  • βœ… Refactored code pushed to GitHub

  • βœ… Clean, feature-based folder structure

  • βœ… A README.md explaining:

    • What was refactored

    • Why the new structure is better

    • List of extracted custom hooks

    • How to run the project

Check App BranchStart the React task

Last updated

Was this helpful?