Hooks and Context
Custom Hooks
HyperLaunch includes several custom hooks to help you reuse state logic across your app. Notable examples include:
hooks/use-subscription-pricing
: Manages pricing logic for subscription cardshooks/use-email-collection
: Handles email collection across different components
React Context
We use React Context to efficiently manage state across multiple components. The main context implementation:
Current User Context
- Located in
current-user-provider.tsx
- Fetches user data from our Next.js backend
- Provides access to user info, plans, and invoices
Usage Example
Note: This approach eliminates prop drilling and simplifies state management throughout your app.