All Typescript posts
What Is the Type of NaN?Updated on · 6 min read|
Build a Tic-Tac-Toe Game with TypeScript, React and MinimaxUpdated on · 12 min read|
In this tutorial we will build a Tic-Tac-Toe game with TypeScript, React, React Hooks, and style it using Styled Components library. Additionally, we'll use the Minimax algorithm to power the AI moves. The final code is available on both GitHub and CodeSandbox.
TypeScript: Typing Form Events In ReactUpdated on · 7 min read|
Handling events in React is very close to how the events on DOM elements are handled. The biggest difference is, however, that React wraps the native DOM events into SyntheticEvent, making them behave slightly differently than the native events. Consequently, typing form events in React is not the same as native events. In this post, we'll see how to type form events in React on the example of a simple component as well as discuss the most common pitfalls.
TypeScript: Typing React UseRef HookUpdated on · 3 min read|
Typing useRef hook in TypeScript seems to be straightforward from the first glance, however there are a few issue that can make it a bit cumbersome. In this article we'll take a look at how to properly type the hook for a few most common use cases.
Simplifying Connected Props with Redux and TypeScriptUpdated on · 3 min read|
When using Redux-connected components there can multiple sources of props. This means a lot of manual typing and maintaining the types in the future. Luckily Redux has a solution for that.