Adding tabs to the viewport

Tabs are a very common component, especially in iOS apps. In this recipe, we will learn how to use the tabs component on iOS devices only. As of now, we don't have support for Android, and if we really want to use tabs, we would have to use a third-party library to add similar functionality.

Getting ready

We need to create an empty app using the React Native CLI. We will name it TabsComponent. Then we will create an src folder in the root of the project where we are going to define all our JavaScript code. We are going to use four different icons, but feel free to use your own or make sure to download the assets for this recipe.

How to do it...

  1. Let's start by importing all the dependencies for this component, as well as ...

Get React Native Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.