Thursday, July 18

Tag: Create React App v2

Web Tricks

Using Create React App v2 and TypeScript

Now that Create React App v2 is out, official TypeScript support comes with it. This is an exciting thing for JavaScript users that use TypeScript. TypeScript is a powerful tool that helps us write safer and self-documenting code. We can catch bugs faster with TypeScript. Many people have opinions about TypeScript, good and bad, but it's a good idea to give it a chance. For this article, we'll focus on getting a Create React App up with TypeScript and we'll do a larger project where we use TypeScript and React together in a future article.   Starting a TypeScript Create React App This is the easiest part! npx create-react-app my-typescript-app --typescript What packages does the --typescript flag get us and what changes does it make? The TypeScript Additions The --type...