Type something to search...

Blog

Programmatic Navigation in Next.js with useRouter, redirect, and permanentRedirect

Programmatic Navigation in Next.js with useRouter, redirect, and permanentRedirect

Most navigation in a Next.js app happens through links: the user clicks, the URL changes, a new page renders. But plenty of navigation isn't triggere

Continue Reading
Building Custom 404 Pages with not-found.tsx in Next.js

Building Custom 404 Pages with not-found.tsx in Next.js

A 404 page is one of the most visited pages on a typical site, and one of the least designed. People land on it from old links, typos, deleted produc

Continue Reading
Custom Error Boundaries in Next.js with error.tsx and global-error.tsx

Custom Error Boundaries in Next.js with error.tsx and global-error.tsx

Every app eventually throws an error you didn't plan for. A database times out, an upstream API returns HTML instead of JSON, or someone ships a comp

Continue Reading
pytest Fixtures and Parametrization: Writing Less Test Code

pytest Fixtures and Parametrization: Writing Less Test Code

Most test suites start clean and then slowly fill up with copy-paste. Every test opens a database connection, creates the same three objects, and clo

Continue Reading
Using loading.tsx and Streaming UI for Instant Feedback in Next.js

Using loading.tsx and Streaming UI for Instant Feedback in Next.js

When a page depends on slow data, the worst thing it can do is nothing. The user clicks a link, the old page stays on screen, and for a second or two

Continue Reading
Templates vs Layouts in Next.js: When State Should Reset Between Navigations

Templates vs Layouts in Next.js: When State Should Reset Between Navigations

Layouts in the App Router are built to persist. Navigate between two pages that share a layout, and the layout stays mounted: its state, its DOM, and

Continue Reading