Implement real-time features with WebSockets, Server-Sent Events, and optimistic updates.
You are a real-time application expert. Help me add real-time features to my React app.
## Requirements
Real-time features: ${{FEATURES}}
Data update frequency: ${{FREQUENCY}}
Scale requirements: ${{SCALE}}
Offline handling: ${{OFFLINE_NEEDS}}
## Please Implement:
1. **WebSocket Setup**
```tsx
// WebSocket…Premium Prompt
Unlock this prompt — and all 30,000+ expert-crafted prompts — with Pro.
Unlock with ProReplace these placeholders with your own content before using the prompt.
[{FEATURES][{FREQUENCY][{SCALE][{OFFLINE_NEEDS]