This course has been updated! We now recommend you take the Complete Intro to React, v7 course.

Check out a free preview of the full Complete Intro to React, v3 (feat. Redux, Router & Flow) course:
The "Fixing flow-typed Definitions" Lesson is part of the full, Complete Intro to React, v3 (feat. Redux, Router & Flow) course featured in this preview video. Here's what you'd learn in this lesson:

Brian shows how to install the needed definitions for styled-components. Due to the version conflicts with flow-typed, not all the definitions required for the demo application were present during installation.

Get Unlimited Access Now

Transcript from the "Fixing flow-typed Definitions" Lesson

>> Brian Holt: And while you were on lunch, I figured out the styled components issue. So let's go back and do that real quick. So when we did flow type, again this is kind of nascent ecosystem here. We're still kind of figuring out how to get this to all play nicely together.

[00:00:17] When we did flow typed install.
>> Brian Holt: It was able to go out and grab almost all the definitions, except one, which is the one definition that we were ignoring. So now, the flow had no concept of this and it was also being ignored. So it just assumed that module didn't exist.

[00:00:39] And the reason why is, styled components was updated, maybe two days before we started this course. And so, I updated it, cuz I wanted to be using the latest and greatest tech. Unfortunately, they haven't had time to release the new types for version two. They only had the types for version 1.4.

[00:00:56] However, the API that we're going to be using, we're not using many of the new features or any of the new features really. So we can go ahead and use the old type definitions and be mostly fine. So I want you to go into your command line, I want you to type flow-typed install styled-components @1.4, I think that should work.

>> Brian Holt: Honestly, you can probably just do 1. Nope, do 1.4. And that'll give you the types for 1.46, I think. Is that what it says? No, it just doesn't say. Okay, so 1.4. And that should be sufficient for what we're using, despite the fact that we're using two.

[00:01:49] So, a little bit of a dangerous operation, right? But it's gonna work, so just rest assured that I've been down this path.
>> Brian Holt: So now if we say yarn flow, it should work. So we can get rid of this. I had right here, dash,dash, flow fix me which it says like ignore the next line, right?

[00:02:13] We can get rid of that now and everything should be working.
>> Brian Holt: It should be saying, no errors.
>> Brian Holt: Cool, any questions about that? Any questions of types or anything like that in general? So I've only shown you like a couple of ways of doing typing. But we're gonna keep going and doing more and more types as we go.

[00:02:41] So we'll be learning little bits and pieces about how to do specific type of adaptation and some of the advantages that you can get from the typing system that we now have in place. Again, none of this is required, right? There's no problem if you just decide to remove @ flow from all of your documents and just keep going without types.

[00:03:01] So I don't want for you to think that this is a required part of React, because it's definitely not, nor is it necessarily tied to React. You can write Angular projects with flow as well.