Typing React (3) Redux

In previous articles we have already explained how to use TypeScript in regular React and with Material-UI. In this article I will show the most important and difficult part: redux.

Previous articles can be found here:

The packages used in this articles are:

$ npm install --save redux react-redux typesafe-actions \
              rxjs redux-observable lodash reselect \
              @types/react-redux

The common and recommended way of using redux is with the combination of redux + typesafe-actions + redux-observable. The configuration is a bit complicated so I will explain piece by piece.

Continue reading

Typing React (1) – Basic

TypeScript has been increasingly popular. The typing system helps eliminate most of the coding errors at compile time. Generally, TypeScript costs you a significant amount of time on coding and typing, but later on i will save you much more time on debugging.

This series attempts to facilitate the painful efforts of typing, especially when you are not quite familiar with TypeScript. Thus we will focus on typing and nothing else – anything not specifically related to TypeScript, such as the usage of redux, will be ignored.

The demo project for this series can be downloaded at my GitHub: https://github.com/charlee/todolist.

Continue reading