Skip to main content Activity Log - 2025-11-25
Reading
Learning
- TypeScript Best Practices:
- Avoid Non-Null Assertions (
!) - use explicit guards or destructuring
- “Parse, Don’t Validate”: Transform loose input into strict types at the boundary
- Use Type Predicates (
isNode(n)) instead of as Node[] for type safety
- React Patterns:
- Controlled vs Uncontrolled: Start with Controlled for critical UI components
- Animation Cleanup: Use
onAnimationEnd instead of setTimeout to avoid magic numbers
- Refactoring Insights:
- Key-based Reset pattern for robust state reset in controlled components
- Layered Architecture: Domain (parsing), State (hook), and UI layers
- Explicit State Clearing on validation failure (YAGNI on unused complexity)