Learning TypeScript

·

2 min read

React-Typescript logo

TypeScript Docs


Why am I learning TypeScript?

I'm looking to get my first role as a junior dev and the benefits of TS (TypeScript) mean that companies are able to use performant tools like React and Node with guardrails when building an app and in production.

During the development phase it means that TS will be catching errors before they get to deployment and arguably reduce the need to test (being a novice tester I'm not sure how true this is). To be clear, TS doesn't eliminate the need to do Unit and End-To-End testing on an app - something I'm learning and will be incorporating into my future apps.

TS also helps guide you when writing code that others have written, by specifying the available attributes that can be passed, making it easier to contribute in a meaningful way.


My progression

  • [x] vanilla TS
  • [x] TS + React
  • [ ] TS + Express + Node
  • [ ] Full-Stack TS
  • [ ] TS + React + GraphQL + Postgres

Vanilla TS

I previously completed the Net Ninja Typescript tutorial which is in Vanilla TypeScript and a useful starting point before moving to React with TS.

Learning React + TypeScript

I studied elements in the React TypeScript Cheatsheets and the 7 part intro to React + TypeScript by Techbase.

The main takeaway here is adding types to elements, specifying types when passing state and being explicit with objects using Interfaces.

It's an interesting addition to React, while it definitely adds lines of code, it helps to be clearer in the intention of what is being coded and reduces errors while building the app.

This episode of Full Stack Radio is useful for understanding the nuances and usecases of testing with a TypeScript app.

Next Steps

I'm currently building a small app to implement TS + React front end. On completion I'll move on to the Full Stack Open tutorial to implement type safety on a Node and Express back end.

On completion I'll build a full stack React, Node, Express and a DB (probably Postgres) to cement my learnings.

Following that I'll step it up and take a look at the Full-Stack React GraqphQL Typescript tutorial