Speaking of my own experience, I walk you through the pros and cons of a TypeScript based React frontend.
Welcome to the first part of this guide, where I teach how to use React with TypeScript!
In this guide, I want to teach you everything you need to know about using React with TypeScript. Over the next weeks, I'll publish new articles to this guide, so if you want to get notified about my latest content, make sure to subscribe to my newsletter.
In this first article, I want to introduce you to TypeScript and look at the pros and cons of adding it to a React project.
The definition is taken from Wikipedia.
The definition above condenses in one sentence what TypeScript is all about.
But let's have a look at what this actually means.
The second part of the definition states that TypeScript adds optional static typing to the language.
Static typing is the most important advantage of using TypeScript. We can add types to the functions and variables in our application.
Often, TypeScript can infer a variable's type by looking at the value we use to initialize it.
The compiler will throw an error if we try to assign a value of the wrong type to this variable.
let name = ''; name = 123;
Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.
Learn how to set up React Navigation in a React Native project using TypeScript, routing for modals and nested navigation, type declaration for navigation, and route props.
In this article, I will be showing you how to add typescript from your existing react application. If you are a software developer that started from strongly typed programming languages.
The best way to learn something is by doing. It works even better if it means working on something for fun. So, how about learning about React, React hooks and TypeScript by building your own meme generator? This tutorial will show you how to do it.
Step 7 in the "React, TypeScript, and TDD" tutorial. React builds UIs as a tree of components. See how to make stateless functional components correctly with TypeScript.