Render video data
Now that we are passing data to VideoDetailsScreen, let’s render the data.- Open
VideoDetailScreen.tsx. - In the parameter list for the VideoDetailScreen component, destructure
navigationandroute, declaring them as typeany.
- Define a new variable to capture the video from the
route.
- Update the
sourceprop for ImageBackground, setting it to{{ uri: video.imgURL }}.
- Replace “Video Title” and “Video Description” in the Text components with
{video.title}and{video.description}.
Add the navigation buttons
Let’s add in the buttons and wire up them up to allow Navigation.- Import the Button component we created.
- Under the two text fields add a View.
- Give the View a style prop of
buttonContainerand add the following style to the style sheet:
- Within the View add the two Button components.
- Set the buttonText prop to be “Watch Button”
- Set the pressFunction prop to be empty for now. In the next section we will set it to navigate to the new VideoPlaybackScreen
- Set the buttonText prop to be “Back”
- Set the pressFunction prop to be
{() => navigation.goBack()}. This will send us back to the LandingScreen, the previous screen in the stack.
VideoDetailScreen.tsx code should look like this:
- Refresh the app and verify that you see the background image, title, and description.
- Verify you can go back to the LandingScreen when you select the “Back” button. We’ll test the “Watch Now” button in the next section.

Background image, title, and description, plus back to LandingScreen

