Tag, 7 posts

React

Design Patterns

React Design Patterns: A Practical Reference

Six patterns that keep showing up in React code: Composition, Custom Hooks, Provider, Compound Components, Server/Client separation and Suspense. Each comes with an everyday analogy, a short code sample and a diagram, plus the catches worth knowing about.

React

A Global Custom 404 Page for Route Groups in Next.js

With route groups and separate layouts, unmatched URLs in Next.js fall back to the default 404 page instead of your own. Why that happens, what doesn't work, and how the experimental globalNotFound option fixes it, including reusing a route group's layout on the global 404.

React

Tables and Modals in Next.js 16: Preserving State

Data tables with edit modals in Next.js 16 that keep their state: an optional catch-all route, intercepting routes, and the layout plus dynamic route setup I ended up with, which preserves pagination and filters and still gives every record its own URL.

React

Next.js 15 Tutorial: Full-Stack App with Ant Design

A records management app built step by step with Next.js 15, Ant Design 5 and React Query 5: layouts, an optional catch-all route, a parallel route for the edit modal, route handlers, and server-side prefetching with hydration. Plus the workarounds Ant Design needs to play along with Server Components.

React

Effortless Form Handling in React with HTML5 Validation API

When we talk about user input within a web app we often think first of HTML forms. Web forms have been available with the very first editions of HTML. Apparently the feature was introduced already in 1991 and standardized in 1995 as RFC 1866. We use them everywhere, with almost every library and framework. But what about React? Facebook gives a limited input on how to deal with forms . Mainly its about subscribing form and controls for interaction events and passing state with value property. So form validation and submission logic is up to you. Decent UI implies you cover such logic as on submit/on input field validation, inline error messaging, toggling elements depending on validity, pristine, submitting states and more. Cannot we abstract this logic and simply plug it in our forms? Definitely we can. The only question is what approach and solution to pick up.