From the course: React: Testing and Debugging

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Type checking with Flow

Type checking with Flow - React.js Tutorial

From the course: React: Testing and Debugging

Start my 1-month free trial

Type checking with Flow

- [Instructor] Another great tool to help prevent bugs is type checking. Type checking is basically a practice of declaring what type of data you should expect to be passed within your application. If the types don't match, type checking throws an error warning that you are trying to pass a number to a variable that is expecting a string for example. React has prop types that you can use within its libraries but I personally prefer to use a tool like Flow which has much more to offer and is also maintained by the Facebook team. What's really good about Flow is that you could use it without setting up your types because Flow offers a lot for you out of the box. So let's take a look at it. So I don't know if you remember earlier when we set up Flow we did a flow here. So we did this mention. So flow is going to check for this file. But I want to do it on a new file. So I'm going to go to single.js which is in the…

Contents