Define the VideoCard component
Now that we have our basic Header component, we need to create our VideoCard component.- Go to the
componentsfolder and create a file calledVideoCard.tsx.
- Import React from ‘react’, and import StyleSheet, Text, View, and Image from ‘react-native’. These components are needed to render a video’s title, description, and image.
- Create an arrow function called VideoCard.
- Return a View that contains an Image component and another View with two Text components (title and description). For now, hard code the Text values to “title” and “description”, and the Image source to https://le1.cdn01.net/videos/0000169/0169322/thumbs/0169322__002f.jpg.
- Export the VideoCard, so that it can be used by other components and screens.
VideoCard.tsx should look like this:
Add Styling
Next, we need to create a new StyleSheet for styling the components in VideoCard.- Add the StyleSheet below after the VideoCard component.
borderRadius to round the edges of the container. We’re also setting justifyContent to ‘space-around’, to get some automatic spacing around the title and description. To learn more about the different options for justifyContent, visit the flexbox documentation.
- Add the new styles to their respective components.
VideoCard.tsx file should now look like this:
Render the VideoCard component
Now let’s go ahead and render our VideoCard from our mainApp.tsx.
- Import VideoCard to your
App.tsxfile.
- Add the VideoCard component after the Header component in the App’s return statement.
- Since JSX requires a parent element, wrap Header and VideoCard in an empty fragment.
App.tsx should look like this:

Video card component example
- If you are using the VegaStudio check the Output window
- If you are using the CLI check the terminal running the metro server

