TypeScript: Guides and Practical Know-how | mironsoft Blog
TypeScript
-
May 5, 2026
Loose markdown files without a schema mean a typo in the frontmatter often only shows up live on the website, frequently in an unexpected place. Content Collections in Nuxt Content v3 bring Zod based schema validation and automatically generated TypeScript types, so exactly these errors become visible at build time, long before a user ever sees the page.
-
May 5, 2026
Conditional types let you make the type of an expression depend on a condition over another type. They sit behind almost every built in utility type, such as Exclude, ReturnType, or Awaited, and solve problems that would otherwise only be solvable with type assertions or duplicated code. This article covers the syntax, practical use cases, and the point where readability breaks.
-
May 5, 2026
React Hooks work even without explicit types, but usually only correctly by accident. As soon as a state can take multiple possible shapes, a ref gets used in three different ways, or a custom hook loads data from an API, typing decides whether errors surface at compile time or only for the user. This article shows how to make React Hooks type-safe from the ground up with TypeScript, from useState to your own generic custom hook.
-
May 2, 2026
Developers moving from Python to TypeScript already have a good feel for type annotations from mypy, but need to understand a fundamentally different type system: structural rather than nominal, checked by a compiler that verifies nothing at runtime.
-
May 2, 2026
The Context API looks simple at first glance, but in practice it produces one of the most common TypeScript traps in React projects: a context without a real default value potentially returns undefined on every useContext call, and the compiler then forces null checks at every single use site that would actually be unnecessary. This article shows how to type the Context API from the start so that a missing provider surfaces already during testing instead of only for the user.
-
Apr 28, 2026
TypeScript offers two fundamentally different tools for representing a fixed set of allowed values: enums and union literal types. Both have legitimate use cases, but the choice has real consequences for bundle size, serialization, and interoperability.
-
Apr 21, 2026
Anyone who wanted to group JavaScript arrays by a criterion used to reach for Lodash, Underscore, or a nested reduce() chain. With Object.groupBy and Map.groupBy, ES2024 finally brings a native, readable solution directly into the language, with a clear difference between the two that is often overlooked in practice.
-
Apr 20, 2026
No more silently optimized-away imports: with verbatimModuleSyntax, the output contains exactly what the source code wrote.
-
Apr 19, 2026
Internationalization in React is often underestimated, right up until the first multi-language requirement lands in the backlog. next-intl offers a complete i18n solution for the Next.js App Router: type-safe translations, ICU pluralization, locale-aware date and number formatting, language routing and full Server Component support without any client bundle overhead.
-
Apr 18, 2026
Since TypeScript 5.0, type parameters can carry the const modifier. This makes the compiler automatically infer the narrowest possible literal types on every call, without the caller having to write as const.