Hey, welcome back.
So we have a new section on a brand new topic, the context API.
So before we go into what it actually is and how it works, I want to talk about where we came from
and where we're going next.
Why are we learning this?
So we talked about react hooks and hooks are awesome.
We're not done with hooks.
We'll return to them in just a bit.
They allow you to write these really cool, functional components that have all the functionality that
regular class based components have.
And they also happen to be a lot shorter and cleaner, easier to understand.
There's a whole bunch of benefits.
So context is something that you can use without hooks, but you can also use it with hooks.
There is a specific react hook that's built in called use context.
So we're going to learn context on its own.
Outside of the context of hooks, we're going to learn first how it works with class based components.
Sort of the old way of context.
I don't want to say the old way, though, because context hasn't been around very long and class based
components aren't going anywhere anytime soon.
But we're going to learn the class based approach first.
Then we're going to take what we learn and apply it to hooks.
So we'll learn how to use context with hook based or functional components.
All right.
So that's what we're going at least for the next couple of sections.
Then after that, we're going to take what we learned about context, about hooks, and we're going
to talk about reducers and state management.
So how do we combine things like the use reducer hook and the use context hook?
Two things we haven't covered yet, so that might make no sense to you.
But these two hooks we're going to learn, we can combine them to help manage the craziness that is
React State.
You might be familiar with Redux or maybe you've at least heard of it.
Redux is a way of centralizing your application state and and logic, basically having this centralized
store that all your components work with and communicate with, retrieve data from via props.
It's it's kind of a big, complicated topic.
We're going to learn how to basically mimic redux without having to use a third party library, how
we can use react hooks, context reducers to get similar functionality.
It's the I don't want to say the new way of doing it.
It's a new way.
We'll talk more about how it compares to Redux and if it if it really is a Redux killer, which is what
you'll hear a lot about on blog posts.
But for now, I just want to that's the lay of the land.
That's where we're going with all of this.
So we're talking about hooks.
We already did that.
We're talking about context on its own in a class based component.
Then we're talking about hooks with context.
Then we're talking about hooks plus context, plus reducers, which is mimicking redux functionality,
state management.
Okay, that's where we're going.
I'm going to stop this video here.
The next one is going to start diving into context.
I'll show you the app we're going to build, explain what context is.
So I'll see you then.