using-the-use-hook
Installation
SKILL.md
Using the use() Hook in React 19
Teaches when and how to use React 19's new use() API: reads Promises (suspending component) and Context (conditionally—inside if statements, loops, after early returns).
Activates when: User mentions use(), use hook, async patterns, Suspense + data fetching, conditional context, or useContext migration.
Key Capabilities vs. Traditional Hooks
| Feature | Hooks | use() |
|---|---|---|
| Conditional calls | ❌ | ✅ |
| After early return | ❌ | ✅ |
| Inside loops | ❌ | ✅ |
| Read Promises | ❌ | ✅ (suspends) |
| Error handling | try-catch | Error Boundary |
Usage Patterns
Reading Promises: