The stale closure, your debounced callback saves old state
REACTStabilizing a debounce with useMemo(() => debounce(fn, 300), []) fixes one bug and creates a worse one: the callback is…
Push 'use client' to leaf components and pass server data down as props
NEXTEverything in the App Router is a Server Component until you add 'use client', and that directive taints the whole subt…
Remember GET route handlers are uncached by default since Next.js 15
NEXTNext.js 15 flipped the default: GET route handlers and the client router cache are no longer cached unless you opt in.…
Invalidate exactly what changed with revalidateTag/revalidatePath after writes
NEXTAfter a mutation, invalidate the specific cache entries it affected rather than forcing a broad refresh or client reloa…
Use Server Actions for internal mutations instead of hand-rolled API routes
NEXTServer Actions run mutation logic on the server and can be called directly from a <form action> or a client handler — n…
Stream slow sections with loading.tsx and Suspense instead of blocking the route
NEXTA route-level loading.tsx wraps the page in a Suspense boundary so the shell streams immediately while data loads. Wrap…
Cache expensive server routes at the edge with defineCachedEventHandler
NUXTNitro's defineCachedEventHandler wraps a server route with stale-while-revalidate caching backed by your configured sto…
Set per-route rendering strategy with routeRules instead of restructuring code
NUXTrouteRules applies a rendering mode per URL pattern in config, so marketing pages prerender, content pages use ISR, and…
Give useAsyncData an explicit key to control dedup and caching
NUXTuseAsyncData dedups and caches by key. Without an explicit key Nuxt derives one from the call site, which can collide w…
Share state across components with useState, never a module-level ref, on SSR
NUXTOn the server a module-level ref is created once and shared by every request, so one user's cart can leak into another'…
Use useFetch in setup and $fetch in handlers to avoid double-fetching
NUXTuseFetch is the SSR-aware wrapper: it runs during server render, serializes the result into the payload, and hydrates o…
Let the React Compiler memoize instead of hand-writing useMemo/useCallback
REACTThe React Compiler analyzes your components and automatically memoizes values and callbacks at build time, following th…
Drop forwardRef in React 19 and accept ref as a normal prop
REACTReact 19 lets function components receive ref as a regular prop, so forwardRef is no longer required for the common cas…
Handle form mutations with built-in pending and error state via useActionState
REACTuseActionState wraps an async action and returns the last result, the action to bind to a <form action>, and a pending…
Read promises and context conditionally with the use() hook
REACTReact 19's use() unwraps a promise or reads context, and unlike the Rules of Hooks it can be called conditionally or in…
Show instant UI with useOptimistic and auto-revert on failure
REACTuseOptimistic renders an expected next state immediately while the real async action runs, then reconciles to the true…
Replace modelValue/update boilerplate with defineModel() for v-model
VUEdefineModel() returns a writable ref wired to the parent's v-model, collapsing the modelValue prop plus update:modelVal…
Cancel stale async work in watchers with onWatcherCleanup()
VUERegistered inside the watcher callback, onWatcherCleanup runs before the next invocation and on stop. It removes the ma…
Destructure props with native defaults in Vue 3.5, but pass a getter to watch
VUEStabilized in 3.5: destructured variables from defineProps compile to props.count on access, so they stay reactive and…
Generate hydration-safe unique IDs with useId() for accessibility
VUEuseId() produces IDs that are stable and identical across server render and client hydration, so label/for and aria-des…
Use useTemplateRef() for typed template refs instead of string-matched refs
VUEVue 3.5 resolves template refs by key at runtime, so the type is inferred and you drop the ref(null) declaration that h…