TypeScript boosts productivity but faces pitfalls like type mismatches, null values, & puzzling errors. Learn to spot & solve these for swift progress.| Total TypeScript
Get productive building applications with React and TypeScript with our interactive guide on React's types - from component props to useRef.| Total TypeScript
Free interactive video tutorial that will help you get started with TypeScript.| Total TypeScript
Zod is a TypeScript-first schema declaration and validation library. In this tutorial, Matt Pocock has prepared a set of exercises that will help you level up.| Total TypeScript
Understand how Type Predicates work in TypeScript, using an example of filtering a mixed array of elements.| Total TypeScript
TypeScript 5.1 is out! With important updates to React Server Components and some small usability updates.| Total TypeScript
How to name your types in TypeScript can be a tricky business. Matt takes you through his opinionated heuristics for how to decide.| Total TypeScript
When should you use return types in TypeScript? The use cases are narrower than you might think...| Total TypeScript
TypeScript 5.0 beta brings a bunch of exciting features, including const annotations and decorators.| Total TypeScript
| Total TypeScript
React's useState can behave in slightly unexpected ways in TypeScript - sometimes giving you undefined when you least expect it.| Total TypeScript
I often find conditional types SUPER hard to read. Here's how to get a better mental model for assignability in TypeScript.| Total TypeScript
A simple function - returnWhatIPassIn - can be enough to stump many newbie TypeScript devs.| Total TypeScript
Still struggling with infer? How about this - you can use it in combination with string literals to manipulate keys of objects.| Total TypeScript
Accessing object values and array members is MUCH more powerful in the type world than it is in the runtime world.| Total TypeScript
This one little tip has saved me hours of refactoring time. Passing string | undefined instead of ?: string ensures that ALL call sites must be given a value.| Total TypeScript
This mental model is INCREDIBLY useful for all sorts of intermediate-advanced typings.| Total TypeScript
If you're thinking about putting a TypeScript package up to NPM, you should be considering preconstruct.| Total TypeScript
You can do some really, really neat stuff with assertion functions inside classes.| Total TypeScript
You can DRY up your generics code MASSIVELY (and improve perf) by assigning local variables to default generic slots.| Total TypeScript
It can be hard to know when to reach for generics. I'll show you when you need them.| Total TypeScript
Mapping over a union type can feel tricky to conceptualise. But actually, TypeScript does it all for you - using Distributive Conditional Types.| Total TypeScript
The "noUncheckedIndexedAccess" is the most awesome config option you've never heard of.| Total TypeScript
You can use generics to dynamically specify the number, and type, of arguments to functions.| Total TypeScript
Globals in TypeScript?! 🤯 'declare global' is a super useful tool for when you want to allow types to cross module boundaries.| Total TypeScript
Want to turn a module into a type? You can use typeof import('./') to grab the type of any module, even third-party ones.| Total TypeScript
Ever wanted just a bit of autocomplete? Here, we create a TypeScript helper called LooseAutocomplete which allows arbitrary values.| Total TypeScript
Deep partials are SUPER useful and not natively supported by TypeScript. Here, I use one to help with mocking an entity in a (imaginary) test file.| Total TypeScript
Using a crazy trick I picked up from @AndaristRake, you can throw detailed error messages for type checks.| Total TypeScript
Generics can be 'locked in' by function calls, meaning that generics can be 'curried' through functions.| Total TypeScript
You can use generics in React to make incredibly dynamic, flexible components. Here, I make a Table component with a generic 'items' type.| Total TypeScript
The looseness of Object.keys can be a real pain point when using TypeScript. It's pretty simple to create a tighter version using generics and keyof operator.| Total TypeScript
Type helpers change the game when it comes to types in your codebase. They help TypeScript infer more from your code - and make your types a lot more readable.| Total TypeScript
The 'extends' keyword is very powerful in TypeScript. Here, I use it to narrow the value of a generic to enable some beautiful autocomplete/inference.| Total TypeScript
Function overloads can be used in conjunction with generics to make incredibly complex and dynamic type signatures.| Total TypeScript
TypeScript's string interpolation powers are incredible, especially since 4.1. Add some utilities from ts-toolbelt, and you've got a stew going.| Total TypeScript
Transform a union to another union, using the in operator as a kind of for-loop. This pattern can be used for almost any kind of transformation.| Total TypeScript
Learn how to derive a union type from an object - an incredibly useful switcheroo that's at the heart of most TS magic out there.| Total TypeScript
Learn TypeScript cursor-rules for AI development. Covers best practices, JSDoc, structure. Differentiates workspace & global rules for better AI coding| Total TypeScript
| Total TypeScript
TypeScript announced a full rewrite of TypeScript in Go. In testing, this rewrite has achieved a 10x speedup in some repositories - and up to 15x in others.| Total TypeScript
TypeScript 5.8's new erasableSyntaxOnly flag enforces pure type annotations by disabling enums, namespaces, and parameter properties.| Total TypeScript
TypeScript is coming to Node 23. Let's break down what that means.| Total TypeScript
Learn how to extract the type of an array element in TypeScript using the powerful `Array[number]` trick.| Total TypeScript
Learn how to publish a package to npm with a complete setup including, TypeScript, Prettier, Vitest, GitHub Actions, and versioning with Changesets.| Total TypeScript
Enums in TypeScript can be confusing, with differences between numeric and string enums causing unexpected behaviors.| Total TypeScript
Is TypeScript just a linter? No, but yes.| Total TypeScript
It's a massive ship day. We're launching a free TypeScript book, new course, giveaway, price cut, and sale.| Total TypeScript
Learn why the order you specify object properties in TypeScript matters and how it can affect type inference in your functions.| Total TypeScript
Learn how to use `corepack` to configure package managers in Node.js projects, ensuring you always use the correct one.| Total TypeScript
Learn how to strongly type process.env in TypeScript by either augmenting global type or validating it at runtime with t3-env.| Total TypeScript
Discover when it's appropriate to use TypeScript's `any` type despite its risks. Learn about legitimate cases where `any` is necessary.| Total TypeScript
Learn why TypeScript's types don't exist at runtime. Discover how TypeScript compiles down to JavaScript and how it differs from other strongly-typed languages.| Total TypeScript
Improve React TypeScript performance by replacing type & with interface extends. Boost IDE and tsc speed significantly.| Total TypeScript
In this book teaser, we discuss deriving vs decoupling your types: when building relationships between your types or segregating them makes sense.| Total TypeScript
Learn how TypeScript's new utility type, NoInfer, can improve inference behavior by controlling where types are inferred in generic functions.| Total TypeScript
Learn how to set up TypeScript to bundle a Node app using pnpm, Node.js, TypeScript, and ES Modules for a seamless development experience.| Total TypeScript
Learn why it's not possible to restrict the type of children in React components with TypeScript.| Total TypeScript
Learn how to make TypeScript functions more flexible and type-safe by using type parameters instead of using 'any'. Improve code reusability and safety.| Total TypeScript
Learn how to handle errors when using Array.reduce to transform arrays into objects in TypeScript. Fix the error by annotating types or using type arguments.| Total TypeScript
Whether you use let or const in TypeScript affects whether or not their values can be changed, and how TypeScript infers them.| Total TypeScript
Learn how to use typescript generics to pass types in constructs like Array and Set.| Total TypeScript
In TypeScript, the `as never` type assertion is occasionally needed when dealing with unions of functions with incompatible parameter types.| Total TypeScript
Using the method shorthand syntax for function annotations in TypeScript can result in runtime errors. It is recommended to use object property syntax instead.| Total TypeScript
Learn about the limitations of React's `forwardRef` TypeScript and discover a solution to enable inference on generic components.| Total TypeScript
TypeScript 5.3 introduces relaxed rules around readonly arrays and improvements in const type parameters.| Total TypeScript
Learn how to provide a TypeScript playground when asking for help with your TypeScript questions, making it easier for others to assist you.| Total TypeScript
Learn how to work with events in React and TypeScript, from onClick to onSubmit.| Total TypeScript
A step-by-step guide on setting up ESBuild to bundle a Node application.| Total TypeScript
When using '--moduleResolution' with the option 'nodenext', it is necessary to add explicit file extensions to relative import paths in EcmaScript imports.| Total TypeScript
Learn how to add TypeScript to your existing React project in a few simple steps.| Total TypeScript
Learn the essential TypeScript configuration options and create a concise tsconfig.json file for your projects with this helpful cheatsheet.| Total TypeScript
Big projects like Svelte and Drizzle are not abandoning TypeScript, despite some recent claims.| Total TypeScript
Learn different ways to pass a component as a prop in React: passing JSX, using React.ComponentType, and using React.ElementType.| Total TypeScript
Learn about TypeScript performance and how it affects code type-checking speed, autocomplete, and build times in your editor.| Total TypeScript
When typing React props in a TypeScript app, using interfaces is recommended, especially when dealing with complex intersections of props.| Total TypeScript
Learn TypeScript in 2023 with this step-by-step guide. Understand the basics, essential types, unions, and narrowing techniques.| Total TypeScript
Learn how to manually assign types to JSON imports in TypeScript by creating `.d.json.ts` files, which can greatly improve performance.| Total TypeScript
TypeScript 5.3 is in the works, with potential features including Import Attributes, throw expressions, isolated declarations, and more.| Total TypeScript
When declaring array types in TypeScript, you can choose between `Array` and `T[]`. Both are identical, but there are some considerations to keep in mind.| Total TypeScript
Learn how to use the `Extract` helper in TypeScript to extract specific members from a discriminated union or based on their shape.| Total TypeScript
If you receive a "Cannot redeclare block-scoped variable 'name'" error in TypeScript, it can be resolved by renaming the variable or changing its scope.| Total TypeScript
Learn the key differences between interfaces and type aliases in TypeScript, including their use cases and important features to consider.| Total TypeScript
In TypeScript, dot notation cannot be used to access type properties, but indexed access types provide more flexibility and are already available.| Total TypeScript
Using useRef with native elements in React can be confusing, but ElementRef provides an easier solution by extracting the element type.| Total TypeScript
Learn how to fix the "Cannot use JSX unless the --jsx flag is provided" error in TypeScript by updating your tsconfig.json file.| Total TypeScript
Understanding generics can be challenging because the term is overloaded. Instead, use the terms "type arguments" and "type parameters" for clarity.| Total TypeScript
What you think of as "generics" in TypeScript are actually three different patterns.| Total TypeScript
Iterating over object keys in TypeScript can be challenging. One option is casting to keyof typeof to access values, or using type predicates.| Total TypeScript
Any `any` is a cause for concern because it disables type checking on the thing it's assigned to. This article explores the best way to avoid them in your code.| Total TypeScript
Matt Pocock shares his advice for working on TypeScript apps where security is critical.| Total TypeScript
This article discusses four of the most important patterns to know and use: Branded types, Globals, Assertion Functions & Type Predicates, and Classes.| Total TypeScript
The optional chaining for assignments proposal has reached Stage 1, allowing assignment to possibly undefined object properties.| Total TypeScript
TypeScript introduces type argument placeholders in version 5.2, which helps with partial inference and lets the language infer types for a function.| Total TypeScript
Learn why {} in TypeScript doesn't represent an empty object, and how to use the Record type to represent an empty object.| Total TypeScript
TypeScript 5.2 introduces 'using', a keyword that disposes anything with a `Symbol.dispose` function upon leaving scope, making resource management easier.| Total TypeScript
Learn how to retrieve object keys where the values are of a specific type in TypeScript using an immediate indexed mapped type.| Total TypeScript
Learn how to fix TypeScript errors regarding the 'Window' interface. Choose between three solutions to add types to the Window object.| Total TypeScript
Learn how to use TypeScript to level-up your applications as a web developer through exercise driven self-paced workshops and tutorials hosted by TypeScript wizard Matt Pocock.| Total TypeScript
The `satisfies` operator in TypeScript allows for type annotations without sacrificing inference. Here's a few uses for it.| Total TypeScript