React & TypeScript: how to type hooks (a complete guide)
Hooks are a fundamental aspect of writing React components, so knowing how to type them is vital to using TypeScript with React. Let's see how to do that!
Devtrium
Use the search below to filter by title, description and tag. There are 11 tutorials currently.
Hooks are a fundamental aspect of writing React components, so knowing how to type them is vital to using TypeScript with React. Let's see how to do that!
TypeScript generics in React are very useful, but can be scary when you don't know how they work. This article will help you understand generics and how to use them in React.
The React useReducer hook is another way to manage state in components. But do you know when to use it vs useState, and how? We'll learn that (and more) in this article.
React Context can be a very powerful tool, and there are several tricks to using it effectively. Several patterns can be used to empower your context use.
Learn how to handle onClick, onChange, and many other events on React with TypeScript. It's a bit harder than you'd think but easy once you know how to do it!
Adding keyboard shortcuts to a React app can empower your users to use it more effectively, and it's pretty simple! We'll see how to do it in this article.
Using asynchronous functions in a useEffect hook is quite common, notably for data fetching. Let's see several ways of going about it!
If you want to use functional components in React, you'll have to deal with dependency arrays. Do you know how to use them and what purpose they serve?
setInterval allows us to schedule an action in the future. It's often very useful in web apps. Let's see how to set it up in React apps.
setTimeout allows us to schedule an action in the future. It's often very useful in web apps. Let's see how to set it up in React apps.
Have you ever wanted your JavaScript code to pause for a certain amount of time? Here's how to do it!