All right, my friends, let's take a look at a solution to the big thing to keep in mind here is that
we are making a network request from inside of a use effect function.
Network requests are always asynchronous in nature, so we probably want to make use of that async O8
syntax here, but we cannot use a wait directly inside of a U.S. fact function.
So in other words, we cannot mark that function right there with a sink not allowed.
And if we do that, we'll end up with an error.
So instead, one pattern we can use is to define an extra function inside of use effect.
Maybe we can call it something like fetch users.
And we are allowed to mark that function as async.
Right after defining that function, we can then call it ourselves manually now inside there, we can
place as much async, await logic as we wish.
So in this case, I'm going to get back some data.
By making a request with Axios to that URL like so.
Don't forget to mark the request right there with O8.
And then in addition, recall that whenever we make a request with Axios, we get back a response object
and one property of that response object is data.
So we only care about the data in this case, which is why we are structuring off the data property.
So finally, once we get that data, well, then use it to update our users piece of state, which was
already defined up here.
We can do a set, users assign data like so, and that should be it, and sure enough, there's my list
of users, so I'm going to check my solution and see how I'm doing.
As usual, little pause here.
All right, there we go.
Looks perfect.
Let's take a pause right here and continue on.