In this video we're going to start to understand how we're going to implement this blog post provider.
Remember this is going to be a component that's going to share information with all the different components
or screens inside of application.
So let's take a look at a diagram and understand how this thing is going to work.
So that new component is going to use a new system that we've not used before called context.
Context is very similar to props and so understanding how context works is usually easiest if we kind
of get a quick reminder on props first and then kind of compare and contrast between these two different
systems.
So as a quick reminder on the prop system we've been using this throughout the course the prop system
is all about communicating information from a parent element to an immediate child.
The downside to this prop system and we kind of saw this back on our search screen component inside
the last application is that if we ever want to communicate data down multiple let levels or layers
of components we end up having to write a lot of code and we're essentially writing all that code to
just kind of shepherd around or move around all this data so the prop system is great.
But again if we would need to move data down multiple levels it turns into a little bit of a pain so
the context system solves that problem specifically the context system is all about moving information
from a parent element to a nested child.
So we're essentially talking about this kind of situation right here.
If the blog post provider wanted to share some information with the blog list using only props we would
have to have the blog post provider pass some information to the stack navigator then the stack navigator
would have to pass that to the index screen and then the index screen would pass it to the blog list.
That's using the prop system but with context we can essentially have the blog post provider pass some
data directly down to that blog list component instead.
So it saves us from having to write out a lot of code.
The downside to the content system is that it's a little bit more complicated to setup.
And in particular there's a couple of special terms that are just a little bit confusing okay.
So at this point I just want to highlight the big difference between these two systems perhaps is all
about from a parent to an immediate child.
Context is from a parent to some deeply nested child.
So now we understand the difference between these two.
Let's take another quick pause.
When we come back the next video we're going to set up this context thing inside of a new component
that we're going to call blog post provider.