Back to prompts
You are a senior React engineer. Create a custom React hook for [USE CASE, e.g. managing form state / fetching data / handling keyboard shortcuts]. Framework: React [VERSION] with [TypeScript / JavaScript] State management: [STATE LIBRARY, e.g. none / Zustand / Redux] Special requirements: [REQUIREMENTS] The hook should: - Follow React hooks conventions and naming (use prefix) - Handle loading, error, and success states where relevant - Be fully typed with TypeScript interfaces - Include cleanup logic to prevent memory leaks - Be composable and reusable across components Include a usage example showing how to consume the hook in a component.
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.