I build software with React and NextJS
1 min read recipes
- TS Discriminated union
- Exhaustive switch check in TS
- TS function overload
- String builder mutability C#
- Branded type predicates
- Creating context provider and useContextState in one helper
- App access permission management
- Optimization cheatsheet in React
- Zustand create store factory
- Zustand WithImmer middleware
- Pick helper
- Connecting Zustand to Redux devtools
- Typing reducer actions
- Typed React Context Factory Abstraction
- Scalable application initial setups
- Form data without refs
- Include metadata into response
- Git Tag: semantic versioning
- Function currying: testing usecase
- False positives / negatives in implementation testing
- Call all helper
- Safe useReducer dispatch
- Memoizing derived state
- Serializable localStorage hook
- Optimistic updates for better UX
- Instant UI update on data mutaion
- Cancelling queries
- Refetching vs Invalidating queries
- Dependent queries with react-query
- Parallel Queries with react-query
- React-Query key pattern
- Client state vs Server state
- Two Forms of Pre-rendering
- Setup NextJS 12 to support SVG imports
- When to Use Static Generation v.s. Server-side Rendering