{"id":"6b09aa825a5e2dbc3f20a4ad","slug":"react-forms-validation","title":"Formularze w React – react-hook-form, Zod, dostępne błędy, walidacja asynchroniczna i podgląd pliku","summary":"Budujemy formularz zgłoszenia lokalu partnerskiego pierogarni – schemat Zod jako jedno źródło reguł i typów, react-hook-form bez zbędnych renderowań, błędy czytelne dla czytników ekranu, debounce'owane sprawdzanie dostępności adresu, błędy z serwera, lista dynamicznych pól i podgląd logo przed wysłaniem.","servedLang":"pl","availableLangs":["pl","en"],"topics":["react","typescript"],"techs":["typescript","javascript"],"tags":["react-19","react-hook-form","zod","forms","validation","accessibility","wcag","async-validation","file-upload","aria"],"level":"intermediate","kind":"tutorial","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":18,"stats":{"views":1,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T16:06:26.491Z","updatedAt":"2026-11-27T16:08:48.916Z","requestedLang":"pl","theme":{"hero":"classic","heroMedia":null,"accent":"indigo","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Formularze w React 19 z react-hook-form 7 i Zod 4 – zodResolver, mode onTouched, useWatch, useFieldArray, Controller, setError z serwera, podsumowanie błędów, aria-invalid i aria-describedby, walidacja asynchroniczna z debounce, z.file() i podgląd obrazka z URL.createObjectURL.","wordCount":3531,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Formularz to miejsce, w którym aplikacja najczęściej rozmawia z człowiekiem – i gdzie najłatwiej go zgubić. Komunikat „Nieprawidłowe dane” bez wskazania pola, błąd widoczny tylko jako czerwona ramka albo przycisk, który jest nieaktywny bez wyjaśnienia, kosztują konwersję i wykluczają osoby korzystające z czytników ekranu. W tym poradniku zbudujesz formularz, który waliduje dane w trzech warstwach, mówi dokładnie, co poprawić, i nie renderuje się przy każdym naciśnięciu klawisza."}]},{"type":"callout","attrs":{"variant":"info","title":"W skrócie"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Schemat Zod to jedno źródło prawdy","marks":[{"type":"bold"}]},{"type":"text","text":": reguły, komunikaty i typy TypeScript. Ten sam schemat możesz uruchomić na serwerze."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"react-hook-form trzyma wartości poza stanem Reacta","marks":[{"type":"bold"}]},{"type":"text","text":" (niekontrolowane pola), więc wpisywanie nie renderuje formularza. Renderuje się tylko to, co subskrybujesz: błędy, "},{"type":"text","text":"isSubmitting","marks":[{"type":"code"}]},{"type":"text","text":", obserwowane pola."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Dostępność to nie dodatek","marks":[{"type":"bold"}]},{"type":"text","text":": etykieta połączona z polem, "},{"type":"text","text":"aria-invalid","marks":[{"type":"code"}]},{"type":"text","text":", "},{"type":"text","text":"aria-describedby","marks":[{"type":"code"}]},{"type":"text","text":" wskazujące komunikat, podsumowanie błędów z fokusem po wysłaniu i statusy w "},{"type":"text","text":"aria-live","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]}]}]},{"type":"callout","attrs":{"variant":"tip","title":"Co zbudujesz"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Formularz „Zostań lokalem partnerskim” w Vite + React 19 + TypeScript: nazwa, e-mail, NIP z sumą kontrolną, adres strony sprawdzany asynchronicznie (debounce + anulowanie żądań), dynamiczna lista stref dostawy ("},{"type":"text","text":"useFieldArray","marks":[{"type":"code"}]},{"type":"text","text":"), logo z podglądem i walidacją typu oraz rozmiaru, zgoda na regulamin, podsumowanie błędów i obsługa błędów zwróconych przez serwer. Kod (12 plików) pobierzesz jako ZIP, a uproszczoną wersję uruchomisz od razu poniżej."}]}]},{"type":"paragraph","content":[{"type":"text","text":"Wymagania wstępne:","marks":[{"type":"bold"}]},{"type":"text","text":" Node.js 22.22+ (zalecany 24 lub 26 LTS), React na poziomie hooków (patrz "},{"type":"text","text":"poradnik React","marks":[{"type":"link","attrs":{"href":"/pl/articles/react"}}]},{"type":"text","text":"), podstawy TypeScriptu i HTML-owych formularzy."}]},{"type":"stats","attrs":{"items":[{"value":"26 → 2","label":"renderowania formularza","hint":"przy 25 znakach: `useState` vs react-hook-form"},{"value":"3","label":"warstwy walidacji","hint":"HTML, klient (Zod + async), serwer"},{"value":"0","label":"`useState` na pola","hint":"wartości trzyma react-hook-form"},{"value":"1","label":"schemat","hint":"reguły, komunikaty i typy w jednym miejscu"}]}},{"type":"heading","attrs":{"level":2,"id":"trzy-warstwy-walidacji"},"content":[{"type":"text","text":"Trzy warstwy walidacji"}]},{"type":"paragraph","content":[{"type":"text","text":"Walidacja po stronie klienta to wygoda użytkownika, nie zabezpieczenie. Każdy, kto otworzy DevTools, wyśle do API, co zechce. Dlatego planujesz trzy warstwy, a każda ma inne zadanie:"}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart LR\n  subgraph B[\"Przeglądarka\"]\n    H[\"HTML<br/>type=email, inputMode,<br/>accept, autocomplete\"] --> Z[\"Zod (synchronicznie)<br/>format, długość,<br/>suma kontrolna NIP\"]\n    Z --> A[\"Sprawdzenie asynchroniczne<br/>czy adres strony jest wolny<br/>(debounce 400 ms)\"]\n  end\n  A -->|\"FormData\"| S[\"Serwer<br/>ten sam schemat Zod<br/>+ unikalność, uprawnienia,<br/>prawdziwy typ pliku\"]\n  S -->|\"409: e-mail zajęty\"| E[\"setError na polu<br/>+ fokus\"]","caption":"Kto sprawdza co – od atrybutów HTML po serwer"}},{"type":"paragraph","content":[{"type":"text","text":"Atrybuty HTML nie walidują (formularz ma "},{"type":"text","text":"noValidate","marks":[{"type":"code"}]},{"type":"text","text":", żeby nie mieszać dymków przeglądarki z naszymi komunikatami), ale nadal pracują: "},{"type":"text","text":"type=\"email\"","marks":[{"type":"code"}]},{"type":"text","text":" i "},{"type":"text","text":"inputMode=\"numeric\"","marks":[{"type":"code"}]},{"type":"text","text":" dają właściwą klawiaturę na telefonie, a "},{"type":"text","text":"autocomplete","marks":[{"type":"code"}]},{"type":"text","text":" pozwala przeglądarce wypełnić pola – to też wymaganie dostępności (WCAG 1.3.5)."}]},{"type":"heading","attrs":{"level":2,"id":"krok-1-projekt"},"content":[{"type":"text","text":"Krok 1. Projekt"}]},{"type":"codeBlock","attrs":{"language":"bash"},"content":[{"type":"text","text":"npm create vite@latest pierogi-partner-form -- --template react-ts\ncd pierogi-partner-form\nnpm install react-hook-form zod @hookform/resolvers\nnpm run dev"}]},{"type":"codeGroup","attrs":{"title":"Konfiguracja, start aplikacji i style"},"content":[{"type":"codeBlock","attrs":{"language":"json","filename":"package.json"},"content":[{"type":"text","text":"{\n  \"name\": \"pierogi-partner-form\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"tsc --noEmit && vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"dependencies\": {\n    \"@hookform/resolvers\": \"^7.0.9\",\n    \"react\": \"^19.3.1\",\n    \"react-dom\": \"^19.3.1\",\n    \"react-hook-form\": \"^7.92.0\",\n    \"zod\": \"^4.6.7\"\n  },\n  \"devDependencies\": {\n    \"@types/react\": \"^19.3.3\",\n    \"@types/react-dom\": \"^19.3.0\",\n    \"@vitejs/plugin-react\": \"^6.3.0\",\n    \"typescript\": \"~7.0.2\",\n    \"vite\": \"^8.4.0\"\n  }\n}"}]},{"type":"codeBlock","attrs":{"language":"json","filename":"tsconfig.json"},"content":[{"type":"text","text":"{\n  \"compilerOptions\": {\n    \"target\": \"es2023\",\n    \"lib\": [\"ES2023\", \"DOM\", \"DOM.Iterable\"],\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"bundler\",\n    \"types\": [\"vite/client\"],\n    \"jsx\": \"react-jsx\",\n    \"strict\": true,\n    \"noUncheckedIndexedAccess\": true,\n    \"verbatimModuleSyntax\": true,\n    \"allowImportingTsExtensions\": true,\n    \"noEmit\": true,\n    \"skipLibCheck\": true\n  },\n  \"include\": [\"src\", \"vite.config.ts\"]\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"vite.config.ts"},"content":[{"type":"text","text":"import react from \"@vitejs/plugin-react\";\nimport { defineConfig } from \"vite\";\n\nexport default defineConfig({ plugins: [react()] });"}]},{"type":"codeBlock","attrs":{"language":"html","filename":"index.html"},"content":[{"type":"text","text":"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Pierogi – become a partner</title>\n  </head>\n  <body>\n    <main id=\"root\"></main>\n    <script type=\"module\" src=\"/src/main.tsx\"></script>\n  </body>\n</html>"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/main.tsx"},"content":[{"type":"text","text":"import { StrictMode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { PartnerForm } from \"./partner/PartnerForm.tsx\";\nimport \"./styles.css\";\n\ncreateRoot(document.getElementById(\"root\")!).render(\n  <StrictMode>\n    <PartnerForm />\n  </StrictMode>,\n);"}]},{"type":"codeBlock","attrs":{"language":"css","filename":"src/styles.css"},"content":[{"type":"text","text":":root { font-family: system-ui, sans-serif; color: #1f2328; }\nbody { margin: 0; }\nform { max-width: 560px; margin: 0 auto; padding: 1rem; }\n.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1rem; }\n.field input:not([type=\"checkbox\"]):not([type=\"file\"]) { padding: .5rem; font-size: 1rem; border: 1px solid #8c959f; border-radius: 6px; }\n.field.has-error input { border: 2px solid #c92a2a; }\n.field.checkbox { flex-direction: row; flex-wrap: wrap; align-items: center; }\n.hint { margin: 0; font-size: .875rem; color: #57606a; }\n.error { margin: 0; color: #c92a2a; font-weight: 600; }\n.summary { border: 2px solid #c92a2a; border-radius: 8px; padding: .5rem 1rem; margin-bottom: 1rem; }\n.summary:focus { outline: 3px solid #4263eb; outline-offset: 2px; }\n.summary h2 { font-size: 1.1rem; margin: .25rem 0; }\nfieldset { border: 1px solid #d0d7de; border-radius: 8px; margin-bottom: 1rem; }\n.zone { display: grid; grid-template-columns: 2fr 1fr auto; gap: .5rem; align-items: end; }\n.slug-status { margin: -.75rem 0 1rem; font-size: .875rem; min-height: 1.2em; }\n.slug-available { color: #2b8a3e; }\n.slug-taken { color: #c92a2a; }\n.logo-input img { display: block; margin-top: .5rem; object-fit: contain; border: 1px solid #d0d7de; border-radius: 8px; }\nbutton { padding: .5rem 1rem; font-size: 1rem; cursor: pointer; }\n@media (max-width: 520px) { .zone { grid-template-columns: 1fr; } }"}]}]},{"type":"heading","attrs":{"level":2,"id":"krok-2-schemat-zod-reguly-komunikaty-i-typy"},"content":[{"type":"text","text":"Krok 2. Schemat Zod: reguły, komunikaty i typy"}]},{"type":"paragraph","content":[{"type":"text","text":"Zaczynasz od schematu, nie od JSX. Opisuje on, jakie dane formularz ma wyprodukować, i od razu daje dwa typy: "},{"type":"text","text":"z.input","marks":[{"type":"code"}]},{"type":"text","text":" (to, co jest w polach) i "},{"type":"text","text":"z.output","marks":[{"type":"code"}]},{"type":"text","text":" (to, co dostaniesz po walidacji i transformacjach)."}]},{"type":"codeGroup","attrs":{"title":"Schemat formularza i walidacja NIP"},"content":[{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/partner/schema.ts"},"content":[{"type":"text","text":"import { z } from \"zod\";\nimport { isValidNip, normalizeNip } from \"./nip.ts\";\n\nconst MAX_LOGO_BYTES = 2 * 1024 * 1024;\n\nexport const zoneSchema = z.object({\n  city: z.string().trim().min(2, \"Enter a city or district\"),\n  minOrder: z.number({ error: \"Enter an amount\" }).min(0, \"Cannot be negative\").max(500, \"Max 500 zł\"),\n});\n\n// One source of truth: validation rules, error messages and TypeScript types.\nexport const partnerSchema = z.object({\n  name: z.string().trim().min(2, \"Enter the restaurant name\").max(80, \"Max 80 characters\"),\n  email: z.email(\"Enter a valid e-mail address\"),\n  nip: z\n    .string()\n    .trim()\n    .refine(isValidNip, \"Invalid NIP – check the digits (10 digits, valid checksum)\")\n    .transform(normalizeNip),\n  slug: z\n    .string()\n    .trim()\n    .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"Use lowercase letters, digits and hyphens\")\n    .min(3, \"At least 3 characters\")\n    .max(40, \"Max 40 characters\"),\n  zones: z.array(zoneSchema).min(1, \"Add at least one delivery zone\").max(10, \"Max 10 zones\"),\n  logo: z\n    .file()\n    .max(MAX_LOGO_BYTES, \"The logo must be smaller than 2 MB\")\n    .mime([\"image/png\", \"image/jpeg\", \"image/webp\"], \"Use PNG, JPG or WebP\")\n    .nullable(),\n  terms: z.boolean().refine((v) => v, \"You must accept the partner terms\"),\n});\n\nexport type PartnerFormInput = z.input<typeof partnerSchema>;\nexport type PartnerFormOutput = z.output<typeof partnerSchema>;"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"src/partner/nip.ts"},"content":[{"type":"text","text":"// Polish tax ID (NIP): 10 digits, the last one is a checksum (weighted sum mod 11).\nconst WEIGHTS = [6, 5, 7, 2, 3, 4, 5, 6, 7];\n\nexport function normalizeNip(value: string): string {\n  return value.replace(/[\\s-]/g, \"\");\n}\n\nexport function isValidNip(value: string): boolean {\n  const nip = normalizeNip(value);\n  if (!/^\\d{10}$/.test(nip)) return false;\n  const digits = [...nip].map(Number);\n  const sum = WEIGHTS.reduce((acc, w, i) => acc + w * digits[i]!, 0);\n  const check = sum % 11;\n  return check !== 10 && check === digits[9];\n}"}]}]},{"type":"paragraph","content":[{"type":"text","text":"Na co zwrócić uwagę:"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Komunikaty piszesz dla człowieka","marks":[{"type":"bold"}]},{"type":"text","text":": „Invalid NIP – check the digits” zamiast „Invalid input”. Komunikat mówi, co poprawić (WCAG 3.3.3)."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"refine","marks":[{"type":"code"}]},{"type":"text","text":" + ","marks":[{"type":"bold"}]},{"type":"text","text":"transform","marks":[{"type":"code"}]},{"type":"text","text":" dla NIP","marks":[{"type":"bold"}]},{"type":"text","text":": najpierw sprawdzasz sumę kontrolną na tym, co wpisał użytkownik (z myślnikami), potem normalizujesz do samych cyfr. W "},{"type":"text","text":"onValid","marks":[{"type":"code"}]},{"type":"text","text":" dostajesz już czyste "},{"type":"text","text":"5260…","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Zod 4","marks":[{"type":"bold"}]},{"type":"text","text":": "},{"type":"text","text":"z.email()","marks":[{"type":"code"}]},{"type":"text","text":" jest funkcją najwyższego poziomu, "},{"type":"text","text":"z.file()","marks":[{"type":"code"}]},{"type":"text","text":" waliduje obiekt "},{"type":"text","text":"File","marks":[{"type":"code"}]},{"type":"text","text":" ("},{"type":"text","text":".max()","marks":[{"type":"code"}]},{"type":"text","text":" w bajtach, "},{"type":"text","text":".mime()","marks":[{"type":"code"}]},{"type":"text","text":"), a parametr "},{"type":"text","text":"{ error: \"…\" }","marks":[{"type":"code"}]},{"type":"text","text":" zastąpił dawne "},{"type":"text","text":"message","marks":[{"type":"code"}]},{"type":"text","text":"."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"zones","marks":[{"type":"code"}]},{"type":"text","text":" jako tablica obiektów","marks":[{"type":"bold"}]},{"type":"text","text":" z "},{"type":"text","text":"min(1)","marks":[{"type":"code"}]},{"type":"text","text":" – błąd „dodaj co najmniej jedną strefę” dotyczy całej tablicy, nie pojedynczego pola."}]}]}]}]},"toc":[{"id":"trzy-warstwy-walidacji","text":"Trzy warstwy walidacji","level":2,"locked":false},{"id":"krok-1-projekt","text":"Krok 1. Projekt","level":2,"locked":false},{"id":"krok-2-schemat-zod-reguly-komunikaty-i-typy","text":"Krok 2. Schemat Zod: reguły, komunikaty i typy","level":2,"locked":false},{"id":"krok-3-dostepne-pole-etykieta-podpowiedz-i-blad","text":"Krok 3. Dostępne pole: etykieta, podpowiedź i błąd","level":2,"locked":true},{"id":"krok-4-sprawdzanie-asynchroniczne-z-debounce","text":"Krok 4. Sprawdzanie asynchroniczne z debounce","level":2,"locked":true},{"id":"krok-5-logo-z-podgladem","text":"Krok 5. Logo z podglądem","level":2,"locked":true},{"id":"krok-6-skladamy-formularz","text":"Krok 6. Składamy formularz","level":2,"locked":true},{"id":"kiedy-react-hook-form-a-kiedy-akcje-formularzy-z-react-19","text":"Kiedy react-hook-form, a kiedy akcje formularzy z React 19","level":2,"locked":true},{"id":"typowe-bledy","text":"Typowe błędy","level":2,"locked":true},{"id":"sprawdz-sie","text":"Sprawdź się","level":2,"locked":true},{"id":"co-dalej","text":"Co dalej","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":52,"visibleBlocks":17,"resources":[{"id":"6b0857cc3c96f2d34d0b4cd9","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=XcI81nVWmWU","embedUrl":"https://www.youtube-nocookie.com/embed/XcI81nVWmWU","title":"Design systems for every user including people and LLMs | ODSP916","description":"Accessibility is often viewed as a usability feature or compliance requirement, important but secondary. In AI‑driven systems, that no longer holds. LLMs interpret the content we produce, and their reliability depends on structure, semantics, and clarity. Accessible content is easier for humans…","author":"Microsoft Developer","thumbnailUrl":"https://i.ytimg.com/vi/XcI81nVWmWU/hqdefault.jpg","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["llm","ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2026-06-03T10:44:45.000Z","popularity":36,"verifiedAt":"2026-11-26T10:56:19.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:15.892Z","updatedAt":"2026-11-26T16:01:15.892Z"},{"id":"6b0857bb3c96f2d34d0b3ff4","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/why-file-uploads-are-hard-lessons-from-uploadcares/id1630667647?i=1000735222397","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id1630667647?i=1000735222397","title":"Why File Uploads Are Hard: Lessons from Uploadcare's Founder Igor Debatur","description":"Igor Debatur, the founder of Uploadcare, joins us to discuss the complexities and challenges of file management in modern applications. Uploadcare specializes in making the file upload experience seamless for users. Igor shares how their journey started from being an agency that built products for…","author":"Software Architecture Insights","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts211/v4/ef/d7/b1/efd7b1fd-13b4-1c00-2cdc-abad25cfc0cf/mza_17371394792725858823.png/600x600bb.jpg","durationSec":1450,"lang":"en","topics":[],"techs":["general"],"tags":["podcast","system-design","security"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2025-11-04T15:00:00.000Z","popularity":47,"verifiedAt":"2026-11-26T11:05:45.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:57.868Z","updatedAt":"2026-11-26T16:00:57.868Z"},{"id":"6b0857b13c96f2d34d0b335a","type":"article","provider":"devto","url":"https://dev.to/perssondennis/21-fantastic-react-design-patterns-and-when-to-use-them-7bb","embedUrl":null,"title":"21 Fantastic React Design Patterns and When to Use Them","description":"Design patterns aren't just for backend developers who can't say a sentence without mentioning...","author":"Dennis Persson","thumbnailUrl":"https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01vzftwtkzrfk3ip2am2.png","durationSec":null,"lang":"en","topics":[],"techs":["javascript"],"tags":["design-patterns","software-architecture","react","webdev","architecture","designpatterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"devto","publishedAt":"2025-08-24T14:41:00.000Z","popularity":50,"verifiedAt":"2026-11-26T10:52:10.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:49.541Z","updatedAt":"2026-11-26T16:00:49.541Z"},{"id":"6b0857c13c96f2d34d0b4451","type":"article","provider":"web","url":"https://khalilstemmler.com/articles/enterprise-typescript-nodejs/functional-error-handling","embedUrl":null,"title":"Functional Error Handling with Express.js and DDD | Enterprise Node.js + TypeScript | Khalil Stemmler","description":"How to expressively represent (database, validation and unexpected) errors as domain concepts using functional programming concepts and how to hook those errors up to our Express.js base controller.","author":"Khalil Stemmler","thumbnailUrl":"https://khalilstemmler.com/img/blog/enterprise-node/enterprise-node.png","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["node","javascript","typescript"],"tags":["databases","functional-programming","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":50,"verifiedAt":"2026-11-26T11:29:27.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857b23c96f2d34d0b3456","type":"repo","provider":"github","url":"https://github.com/vasanthk/react-bits","embedUrl":null,"title":"vasanthk/react-bits","description":"✨ React patterns, techniques, tips and tricks ✨","author":"vasanthk","thumbnailUrl":"https://opengraph.githubassets.com/1/vasanthk/react-bits","durationSec":null,"lang":"en","topics":[],"techs":["javascript"],"tags":["best-practices","design-patterns","javascript","react","react-patterns","reactjs","techniques"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2016-12-20T06:49:54.000Z","popularity":82,"verifiedAt":"2026-11-26T10:57:25.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:49.541Z","updatedAt":"2026-11-26T16:00:49.541Z"}],"challenges":[],"attachments":[],"hasCode":true,"repoUrl":null,"series":[],"prev":null,"next":null,"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":104,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Autorytet","articles":90},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Autorytet","articles":61},{"key":"python","title":"Python","level":5,"levelLabel":"Autorytet","articles":59},{"key":"java","title":"Java","level":5,"levelLabel":"Autorytet","articles":46}]}}