Custom hooks are a great way to wrap up reusable logic inside of reactor application, so there are
going to be many times where you have to use hooks that have been put together by other engineers.
And in some cases, there might not be a lot of documentation around how these hooks work.
So sometimes you're just going to have to read the source code and understand what they are doing for
you.
So this is going to be a quick exercise to kind of walk you through that entire process.
In this little application, we've got to files the aptness file and use Postgres file.
Use post is a custom hook.
It is going to reach out to some API and fetch a list of posts and then somehow return them.
So it's up to you to somehow import that hook into the aptness file and then make use of it inside the
app component.
Our ultimate goal here is to get some kind of host variable inside the app component.
You'll notice that on line six right now, we are trying to access a post variable and it's very clear
that we kind of expect it to be an array.
But right now, post is just not defined.
And so we are probably ending up with an error as it stands right now.
So go ahead, import the hook, try to use it inside the component and get a list of polls to show up
on the screen, go ahead and give this a shot and we'll go over solution in just a moment.