Typing with React
π
In order to encourage people to support my work, I’ve decided to publish a TL;DR version of this chapter for the community. This will allow me to develop more content, so it’s a win-win really.
You can access the full chapter by buying a copy through Leanpubβ. It goes into detail, whereas the following should give you a rough idea of the chapter contents.
TL;DR
π
- propTypesβ are great. Use them to improve the maintainability of your application.
propTypes
give you nice little errors during development, but will be stripped from the production build to improve performance.- Flowβ goes one step further. It provides syntax that allows you to gradually type your JavaScript code.
- While
flow
itself is a static checker you have to run separately, babel-plugin-typecheckβ provides runtime checks during development. - Microsoft’s TypeScriptβ is yet another alternative. Starting from the version 1.6 it will gain JSX support.
Buy the bookβ for the rest.