Skip to content

SanyaShresta25/customhook-demo

Repository files navigation

CustomHook Undo/Redo Demo

This project demonstrates how to use a custom React hook to implement undo and redo functionality in a simple text editor. It supports grouped edits (so undo/redo works naturally), responsive layout, and clear UI using Tailwind CSS.

🔄 Features

  • Custom React hook (useUndo) for managing input history
  • Undo and Redo buttons with simple logic
  • Mobile-responsive layout
  • Styled with Tailwind CSS

🛠 Tech Stack

🚀 Getting Started

# Clone the project
git clone https://github.com/SanyaShresta25/customhook-demo.git

# Navigate to the project
cd customhook-demo

# Install dependencies
npm install

# Run the development server
npm run dev

Then open http://localhost:5173 in your browser.

📁 Project Structure

src/
├── hooks/              # useUndo logic
├── components/         # TextEditor & Buttons
├── App.tsx             # Root layout
├── main.tsx            # Entry point
├── index.css           # Tailwind setup

📚 Learn More

Click the heading in the app to explore: React Custom Hooks — Sharing Logic Between Components


About

A minimal React app demonstrating a custom hook for undo and redo functionality in a text editor. Built with TypeScript, Tailwind CSS, and Vite, featuring responsive design and clean UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors