From the course: React: Testing and Debugging
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Type checking with Flow - React.js Tutorial
From the course: React: Testing and Debugging
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.