.tips
page 8 of 10, 228 small things in all. back to the first.
.february
2026, 9 tips.
git switch and git restore, not checkout
git
git add -p to commit only the lines that belong together
git
git bisect run finds the bad commit while you make tea
gitdebugging
A route handler that returns config should be force-static
nextjsperformance
Invalidate by tag from the code that changed the data
nextjscaching
loading.tsx is a Suspense boundary around the whole segment
nextjs
useId for label and input ids
reactaccessibility
Every effect that subscribes returns an unsubscribe
react
If it happens because the user did something, it is not an effect
react
.january
2026, 16 tips.
use() reads a promise or a context, conditionally
react
In React 19, ref is just a prop
react
Wrap state updates that trigger heavy renders in startTransition
reactperformance
useDeferredValue keeps typing smooth over a slow list
reactperformance
useSyncExternalStore for anything outside React
react
Change the key to reset a component's state
react
queueMicrotask runs before the next paint, setTimeout after it
javascript
const type parameters keep literal types without as const
typescript
Validate once at the edge, then trust the types
typescriptvalidation
using disposes the resource when the block ends
typescript
Set has union and difference now
javascript
Object.groupBy replaces the reduce you keep writing
javascript
Intl formats numbers and dates, so do not hand-roll it
javascripti18n
structuredClone, not JSON.parse(JSON.stringify())
javascript
allSettled when one failure should not sink the rest
javascript
fetch has no timeout, so AbortController is the timeout
javascripthttp