Frontend
The part of the app people see: React, Vite, Tailwind and shadcn/ui, the browser errors that break it, and making it fast, installable and pleasant on a phone.
99 posts · page 3 of 4
React Custom Hooks: How to Write and Share Your Own
A custom hook is a function starting with 'use' that packages stateful logic for reuse across components. The rules, worked examples (useLocalStorage, useDebounce, useMediaQuery, useOnlineStatus), returning values vs tuples, testing them, and when a hook is the wrong abstraction.
React Context: When to Use It (and When Not To)
React Context passes values through the component tree without prop drilling. How createContext, providers and useContext work, a typed auth context example, why every consumer re-renders when the value changes, splitting contexts, and when to use Zustand or TanStack Query instead.
Query Parameters Explained: The ?key=value Part of a URL
Query parameters are the key=value pairs after the ? in a URL, used for search, filters, sorting and pagination. How they're written and encoded, reading them in JavaScript, Express and Next.js, query vs path parameters, and what never to put in them.
TypeScript "Property Does Not Exist on Type": Causes and Fixes
TypeScript says the property you're reading isn't part of the type. The common causes — a typo or hallucinated field, a missing field in your type, union types that need narrowing, unknown/{} types, window and process.env, DOM elements typed too broadly, and catch errors — with proper fixes.
"Objects Are Not Valid as a React Child": How to Fix It
React can render text, numbers and elements, but not plain objects. This error means you put an object, a Date, or a Promise inside JSX. How to find which value it is from the 'keys' in the message, and the fix for each common case.
TypeScript "Object Is Possibly Undefined" (or Null): How to Fix It
TypeScript warns that a value might be undefined or null before you use it — the exact situation that causes 'Cannot read properties of undefined' at runtime. The right fixes: optional chaining, nullish coalescing, early returns and narrowing, typed state and refs, and when the ! operator is acceptable.
Next.js Server Actions: Forms and Mutations Without API Routes
Server Actions (Server Functions) let a form or button call a function that runs on the server, without writing an API route. How 'use server' works, forms with useActionState, validation with Zod, revalidating data, pending states — and why every action is a public endpoint that needs its own auth checks.
Next.js Middleware Is Now Proxy: proxy.ts Explained
In Next.js 16, middleware.ts was renamed to proxy.ts and now runs on Node.js by default. What proxy does, the matcher config, common uses (auth redirects, rewrites, headers, CORS), the codemod to migrate, and why you must still check authorization inside every Server Function and route.
Next.js App Router vs Pages Router: Differences and Whether to Migrate
Next.js has two routers: the older pages/ directory and the newer app/ directory built on React Server Components. How routing, data fetching, layouts and API routes differ, which one new projects should use, and a sensible incremental migration path.
React "Maximum Update Depth Exceeded": Causes and Fixes
React stops your app when a component keeps updating itself in a loop. The usual causes — setState in useEffect with a dependency that changes every render, objects and functions in dependency arrays, calling a setter during render — and how to fix each.
How to Make a Chrome Extension (Manifest V3, Step by Step)
Build a working Chrome extension from scratch: manifest.json, a popup, content scripts that change web pages, the background service worker, permissions, storage, loading it unpacked for testing, and publishing to the Chrome Web Store — plus what Manifest V3 changed.
localStorage vs sessionStorage vs Cookies: Where Should You Store It?
Three ways to store data in the browser, with different lifetimes, sizes and security properties. What each one is for, why login tokens shouldn't go in localStorage, the size limits, and a simple rule for choosing.
JavaScript vs TypeScript: What's the Difference and Which Should You Use?
TypeScript is JavaScript plus types: you describe what shape your data has, and mistakes are caught before the code runs. The real differences, what TypeScript costs you, why most AI tools now generate it, and whether a beginner should start with it.
JavaScript Promises Explained: then, catch, and Promise.all
A promise is JavaScript's way of saying 'I'll have the answer later'. What promises are, the three states, .then and .catch, how async/await relates, running things in parallel with Promise.all and allSettled, and the mistakes that cause unhandled rejections.
JavaScript Array Methods: map, filter, reduce, find and Friends
Most JavaScript in AI-generated apps is arrays being transformed. What map, filter, find, some, every, reduce, sort and includes do, with plain examples, how to chain them, which ones change the original array, and the mistakes that cause bugs.
"TypeError: X Is Not a Function": The Common Causes and Fixes
"is not a function" means you tried to call something that isn't a function — usually undefined, an object, or the wrong kind of value. The usual suspects: .map on a non-array, wrong import, missing await, a typo, or a name collision. How to diagnose each.
React "Invalid Hook Call": The 3 Causes and How to Fix Each
React throws 'Invalid hook call' when a hook runs outside a component, when hooks are called conditionally or in a regular function, or when two copies of React are loaded. How to tell which one you have and fix it — including npm ls react and linked packages.
How to Center a Div (Horizontally, Vertically, or Both)
The internet's favourite CSS joke has simple answers now. How to center anything horizontally, vertically or both with Flexbox, Grid, margin auto and absolute positioning — with the Tailwind classes — and why your centering isn't working.
How to Hard Refresh and Clear the Cache (Chrome, Safari, Firefox, Edge)
Changed your site but still seeing the old version? A hard refresh reloads the page while ignoring the cache. The shortcuts for every browser on Mac and Windows, how to clear the cache for one site, why hard refresh sometimes isn't enough, and how to stop users seeing stale versions.
Google Search Console for Beginners: Set It Up and Read It
Search Console is Google's free tool for seeing how your site appears in search. How to verify your domain, submit a sitemap, read the Performance and Pages reports, fix 'Crawled — currently not indexed', and use URL Inspection to get a new page noticed.
Flutter vs React Native: Which Should You Use for a Mobile App?
Both build iOS and Android apps from one codebase. Flutter uses Dart and draws its own UI; React Native uses JavaScript/TypeScript and native components, usually with Expo. How they compare on language, performance, look and feel, web reuse, AI-tool support and hiring.
Figma to Code: How to Turn Designs Into a Working App
The ways to get from a Figma design to real code: hand-building from Dev Mode, Figma's own code features, plugins, AI tools that read Figma via MCP or screenshots, and AI app builders. What each produces, and how to prepare a Figma file so the result is actually usable.
Fetch vs Axios: Which Should You Use for HTTP Requests?
fetch is built into browsers and Node.js; Axios is a popular library with extra conveniences. How they differ on JSON handling, errors, timeouts, interceptors and upload progress, the same request in both, and why fetch is usually enough now.
"TypeError: Failed to Fetch": What It Means and How to Fix It
"Failed to fetch" means the browser couldn't complete a request at all — no response reached your code. The usual causes are CORS, a wrong URL, mixed content, the server being down, or an ad blocker. How to tell which in under a minute.