We can now navigate a user over to our results show screen remember the screen is going to be all about
fetching a series of images again from the Yelp API and just rendering them out as a list to the user.
So on the screen we now need to somehow know what business or what item right here a user actually tapped
on.
So if we can communicate that information over to the results show screen somehow then this screen can
somehow make a request to the Yelp API and get some list of images as a quick reminder we could take
a look at the Yelp api in order to get a list of images.
We're going to make a request to that you are all right there.
So on the very end of that you are URL we need to add the I.D. of the business that the user tapped
on.
So now this really turns into a big question.
How do we somehow get the information about what business the user tapped on from results list over
to results show screen.
Well it turns out that when we call that navigate function we can essentially pass in a little bit of
information that will be provided to the results show screen.
So in short when we call navigate we're essentially going to form kind of a little information channel
here in our results list is going to essentially tell results show screen.
Here's the idea of the business to show.
So that's what we need to do.
We need to somehow form up that little link warming up that link is actually really easy and straightforward.
We're going to go back to our results list component we're going to find where we call navigate so users
navigate right here and we're just gonna pass in a second argument to it.
So our second argument is gonna be an object that's going to be some information that we're going to
communicate over to that other screen.
In this case we probably just want to communicate the business's I.D. So inside of your output I.D.
And we're going to get the I.D. out of our item remember item inside of the context of render item item
is gonna be our actual results or the business object.
So for I.D. right there we'll put in item dot I.D..
So now when our results show component is displayed it will have this extra little piece of information
which is the idea of the business that it needs to show case we can save this file or then go back over
to my results show screen.
Here it is right here.
So now we need to somehow get that little piece of information inside of this component to do so it
is not added directly into our parameter object.
Remember first me props object the props object is information communicated from a parent component
in order to get that information inside of results show screen we're going to accept that.
Navigate prop which remember is that big object with all those or I mean not navigate but navigation
is that big object with all those different functions tied to it.
And then on there there is a function.
So navigation called Get param and we'll call it with I.D..
So this is how we're going to get some information out of that second argument that we called navigate
with.
So we call it get param and pass in the name of the parameter that we want we're using I.D. because
back here inside of results list that second object had an I.D. property inside of it.
So we're essentially saying give me that piece of information right there okay.
So back inside of our results show screen I'm going to assign that to a variable like so and then I'll
just do a quick console log to make sure that the idea is showing up successfully.
So I going to save this put back over tap on a business and I should bill to go back with my terminal
and see the I.D. up here.
Yep there it is right there.
Perfect.
So that's how we're gonna communicate information from one screen to another.
Anytime we're doing some amount of navigation now we have the I.D. we can take a quick pause and come
back the next video we'll start to write out some logic to make a follow up request to Yelp and get
a list of images to show inside of our results show screen.